Looking for a way to programmatically insert comments (using the comments feature in Word) into a specific location in a MS Word document. I would prefer an approach that is usable across recent versions of MS Word standard formats and implementable in a non-Windows environment (ideally using Python and/or Common Lisp). I have been looking at the OpenXML SDK but can’t seem to find a solution there.
Looking for a way to programmatically insert comments (using the comments feature in Word)
Share
Here is what I did:
This should give you an idea what you need to do. After that, you can use one of the XML libraries in Python to parse the document, change it and add it back to a new ZIP archive with the extension ‘.docx’. Simply copy every other entry from the original ZIP and you have a new, valid Word document.
There is also a library which might help: openxmllib