python Programming Glossary: document.xml
How can I read a Word 2007 .docx file? http://stackoverflow.com/questions/116139/how-can-i-read-a-word-2007-docx-file
Find and replace text in .docx file - Python http://stackoverflow.com/questions/16867594/find-and-replace-text-in-docx-file-python described below using the zipfile module and replacing the document.xml file in the docx archive. For this to work you need a template.. C NewDocument.docx a with open templateDocx.extract word document.xml C as tempXmlFile tempXmlStr tempXmlFile.read for key in replaceText.keys.. file in templateDocx.filelist if not file.filename word document.xml newDocx.writestr file.filename templateDocx.read file newDocx.write..
|