Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inserting a comment in docx file using python 3

I'm trying to write an application that scans a word .docx file and offers suggestions. I want to ideally put the suggestions on the document itself using MS Word's annotation functionality. (Here is an image of what I'm talking about if i'm not being clear -

MS Word Annotation Functionality

My question is how do I achieve this in Python. I looked through Python-docx's functionality, but didn't find anything there.

Alternatively, I was thinking of manually doing it, where I'd programmatically go into the docx file, go into the xml file, and add the comment that way but I'm not sure how to approach this and I'm not sure if there is a better way to do it.

Please advise :)

Appreciate the help in advance!

like image 347
Shafiq Mohammed Avatar asked Sep 02 '25 09:09

Shafiq Mohammed


1 Answers

for anyone else looking, this is a fork from python-docx that implements comment functionality.

like image 112
Craig H Avatar answered Sep 05 '25 00:09

Craig H