-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to get the comments and Corresponding content from a docx file ? #483
Comments
Maybe you can use from lxml import etree
import zipfile
ooXMLns = {'w': 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'}
docxFilePath = "Your Docx File Path."
docxZip = zipfile.ZipFile(docxFilePath)
documentXML = docxZip.read('word/document.xml')
et = etree.XML(documentXML)
commentRangeStarts = et.xpath('//w:commentRangeStart', namespaces=ooXMLns)
elem = commentRangeStarts[0].getnext()
|
For anyone coming to this from Google (like me), this worked for me:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
<w:commentRangeStart w:id="0"/>
<w:r>...</w:r>
<w:commentRangeEnd w:id="0"/>
how to get <w:r>...</w:r> above
The text was updated successfully, but these errors were encountered: