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

Free Support Forum - aspose.com

Password protected Word (docx) cannot be open


Here is my code:

doc = new Aspose.Words.Document(buf, new Aspose.Words.LoadOptions(password));

Input file attached

Hi Tony,


First off, please try to use the latest version at your end and see if it resolves your issue. However, if it still doesn’t resolve your issue then please share the exception details with us. Also, please share the details of the environment where it fails i.e. OS, .NET Framework version, application type (Web, Windows, Service etc.). We’ll investigate the issue at our end and guide you accordingly.

We’re sorry for the inconvenience.

Yes, I did try 11.0.0.0 and 10.7.0.0:

Windows 7
.NET 2.0
Standardalone application

Thanks.

Hi Tony,


Thanks for your inquiry.

Your document is protected with a “open password”. This causes Microsoft Word to encrypt the document based on this password and provides strict security on the document. Aspose.Words cannot open such documents without the correct password. When it comes to other password protection such as modify password or document protection do not encrypt the document, therefore Aspose.Words can open these documents even without the password.

This exception lends itself that the password you are using is incorrect or non-existent. Could you please double check this on your side? If you are still having troubles could you please supply us with the password for your attached document and preferably the original document before encryption.

Note that all attachments made on the forum are visible by you and the Aspose staff only. You can also choose to e-mail me your password by clicking the “Contact” drop down on my post.

Thanks,

Thanks for your reply. This is a test file, so nothing is confidential. The password is 12345. Unprotected file is attached.

Hi Tony,


Thanks for this additional information.

I’m afraid I couldn’t reproduce any issue with your document using the latest version of Aspose.Words and the following code:

<span style=“font-size:
10.0pt;font-family:“Courier New”;color:#2B91AF;mso-no-proof:yes”>FileStream<span style=“font-size:10.0pt;font-family:“Courier New”;mso-no-proof:yes”> fileStream
= new FileStream(“sdf.docx”, FileMode.Open);<o:p></o:p>

Document doc = new Document(fileStream, new LoadOptions("12345"));


Could you please make sure you are using the latest version on your side. If the problem persists, could you create a simple application which reproduces the issue and attach it here?

Thanks,

I double checked my code, there is one issue in my side. Thanks a lot for helping me out.

Hi Tony,


It’s great you were able to resolve the issue on your end. Please let us know if we can help with anything else.

Thanks,