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

Free Support Forum - aspose.com

Can I save a docx etc. with a password


I know I can save a .doc with a password.

But are there more document types I can save with a password?
Like .docx for instance?

Maybe I missed it but I could not find info for this…


Hi Marcel,

Thanks for your inquiry. Please try using the following code:

Document doc = new Document(getMyDir() + “test.docx”);
OoxmlSaveOptions options = new OoxmlSaveOptions(SaveFormat.DOCX);
doc.save(getMyDir() + “awjava-16.3.0.docx”, options);

Hope, this helps.

Best regards,

Thanks Awais,

Got it working now!