top | item 32209111

(no title)

alexanderh | 3 years ago

haha I wrote something like this in python once.

discuss

order

karteum|3 years ago

Me too : I wrote a few lines of Python for my personal use, to remove docx write protection, and a few other useful stuffs e.g. changing author names, shrinking the size of the document by converting .png/.emf to .jpg, etc. The function for removing the write protection is very short :)

  xmldata = ZipFile(docxfile).open("word/settings.xml").read().decode()
  xmldata = re.sub("<w:documentProtection .\*/>", "", xmldata)
=> I wrote it for my personal use and for a few friends, and it is unfinished and not very well written, but if it can be useful to others, my little tool is here https://github.com/karteum/Doctool