I wish to be able to write to an open word document using python-docx. However this throws a IOError: [Errno 13] Permission denied: 'test.docx'
which i had kind of suspected due to similar cases in the past, but i would like to be able to alter the document without having to close and open it which takes word a long time, for a relatively fast and short operation (appending bibliographies to the end of word doc ie assignment).
Opening and reading is perfectly fine and easy (thus that access is granted), however, I am not able to actually save the file (with the same name of course as the user must not notice) as this throws the error. When the file is not open in word, the error goes away, but this is not acceptable (to close and reopen continuously).
Perhaps there is another way to save documents in word with python-docx? One that involves appending instead of destroying and recreating i think would be much better (such as when one accesses a .txt file with "with" or "read".
It would be much better to be able to somehow add text to a word document while it is open, resulting in a better and faster experience for the user as well.