We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Unprotect not having any effect


Please could you show me the correct method to remove a password from a document.

In my use case, I am taking a password protected word document then wishing to remove the password and save it.

However opening the Document, calling unprotect() and saving again doesn’t have any effect. When I try and reopen the document (from Word) it is still requesting a password to enable editing.


Hi David,

Thanks for your inquiry. You can refer to refer to the following article and try using the latest version of Aspose.Words for Java 14.10.0:

In case the problem still remains, please attach your input Word document, share password with us and attach output Word document showing the undesired behavior here for testing? We will investigate the issue on our end and provide you more information.

Best regards,


Please find attached test.docx

The password is c[tCic#<IEg<6tn

In my code I am opening it with the password supplied in new LoadOptions()

I then call unprotect and save.

Manually I try to open the document in Word and the password request still occurs.


Hi David,

Thanks for your inquiry. I tested the scenario and have managed to reproduce the same problem. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-11047. Our development team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

Hi David,

Please note that the source document is actually DOC. There are two types of document protection.

  • Document.DocumentProtection
  • Document.WriteProtection

Unprotect() method removes only Document.DocumentProtection.

In order to remove write protection you should use doc.WriteProtection.SetPassword(""). Setting empty password to write protection removes this type of protection from document.

I hope, this helps.

Best regards,

Hi David,

It is to update you that our development team has completed the work on your issue (WORDSNET-11047) and has come to a conclusion that this issue and the undesired behaviour you’re observing is actually not a bug. So, we have closed this issue as ‘Not a Bug’. Please see analysis in my previous post.

Best regards,