Wednesday, December 11, 2019

Unprotect (Remove Password) from DOCX-Files

The file needs to be in .docx format:
  • Create a back-up copy of the file.
  • Change the extension from .docx to .zip or unzip with 7zip, if installed.
  • Open new .zip file and extract all files.
  • In the extracted folder go to to word\settings.xml.
  • Open settings.xml and remove the code from <w:documentProtection to /> and save the file. You can either change w:enforcement value to 0 or remove the block entirely.
  • Copy the new settings.xml to the original .zip file and overwrite the old one. Or create a new zip file from the entire folder.
  • Rename the .zip to .docx and open file which is now protection-free!
Or:
  1. Open your document in Word, then save it in ".xml" format.
  2. Open the .xml doc in wordpad, emacs, or your favorite text editor.
  3. Search for the string w:enforcement="1".
  4. Replace the "1" with a "0" to disable enforcement (i.e., unlock the document).
  5. Save the document from your text editor.
  6. Open the .xml document in Word.
  7. Choose "Save as..." and save it as a .doc or .docx file.