I want to make some simple edits on a Word document, eg replace all TEXT with text.
I have tried python-docx, but it doesn’t let me save only my changes. Instead it makes a new document with default style and saves it with my content.
Is there a good library(Python or other languages) that supports quick edits on docx?
Little bit of why you are not able to do simple string replace in docx – a .docx document is a Zip archive in OpenXML format: you have first to uncompress it. Earlier I used to use
zipto unzip the docx & then search for the text, like so –But later I found this excellent python library for docx – Python-docx which will solve your problem.