Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active November 16, 2021 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/a4151d5021f76c18f513634e2c90d480 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/a4151d5021f76c18f513634e2c90d480 to your computer and use it in GitHub Desktop.
Unprotect Word Documents using Python
import aspose.words as aw
# load password protected Word document
doc = aw.Document("document-password-protected.docx", aw.loading.LoadOptions("password"))
# remove restrictions
doc.unprotect()
# save updated document
doc.save("document-unprotected.docx")
import aspose.words as aw
# load password protected Word document
doc = aw.Document("document-password-protected.docx", aw.loading.LoadOptions("password"))
# save document
doc.save("document-unprotected.docx")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment