You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've read the docs and perused the API but can't find any way to access comments in a document. For example, if you highlight some text in Word and add a comment for that text. Are comments exposed by python-docx?
The text was updated successfully, but these errors were encountered:
There's no API support for it, not any support at all except to access the raw xml. The very basic structures are there to load it, and the package has plenty of general purpose XML parsing sugar, so it wouldn't be a big stretch to add support in the future. Here is how to get the XML:
from docx import Document
from docx.opc.constants import RELATIONSHIP_TYPE as RT
p = Document('myfile_with_comments.docx')
cpart = p.part.part_related_by(RT.COMMENTS)
xmlString = cpart.blob
print(xmlString)
I've read the docs and perused the API but can't find any way to access comments in a document. For example, if you highlight some text in Word and add a comment for that text. Are comments exposed by python-docx?
The text was updated successfully, but these errors were encountered: