- is there any options to secure a MS Word document?
- Can I password protect it?
- Can I disable printing,
- Can I disable copying etc…
Thanks
Thanks
Hi Nitin,
Thanks for your inquiry. Please note that Aspose.Words for .NET is a class library that enables your applications to perform a great range of document processing tasks. Aspose.Words supports DOC, DOCX, RTF, HTML, OpenDocument, PDF, XPS, EPUB and other formats. With Aspose.Words you can generate, modify, convert, render and print documents without utilizing Microsoft Word®.
Aspose.Words mimics the same behaviour as MS Word does. You can not disable print and copy option using Aspose.Words. These are MS Word (Application) level setting which are not stored in the document and therefore cannot be controlled by Aspose.Words.
Please use the Document.Protect Method (ProtectionType, String) to protect the document from changes and optionally sets a protection password. Specify null or empty string if you want to protect the document without a password. Please read following documentation links for your kind reference.
http://www.aspose.com/docs/display/wordsnet/ProtectionType+Enumeration
https://docs.aspose.com/words/java/protect-or-encrypt-a-document/
Document doc = new Document(MyDir + "in.docx");
doc.Protect(ProtectionType.ReadOnly, "password");
doc.Save(MyDir + "Out.docx");
When a document is protected, the user can make only limited changes, such as adding annotations, making revisions, or completing a form. When you protect a document, and the document already has a protection password, the existing protection password is not changed.
Moreover, Please use the OoxmlSaveOptions.Password to encrypt Docx document and DocSaveOptions.Password to encrypt Doc document. Please read following documentation links for your kind reference.
https://reference.aspose.com/words/net/aspose.words.saving/docsaveoptions
https://reference.aspose.com/words/net/aspose.words.saving/ooxmlsaveoptions
Following code example shows how to set a password to encrypt the document.
Document doc = new Document(MyDir + "in.docx");
OoxmlSaveOptions opt = new OoxmlSaveOptions(SaveFormat.Docx);
opt.Compliance = OoxmlCompliance.Iso29500_2008_Transitional;
opt.Password = "password";
doc.Save(MyDir + "AsposeOut.docx", opt);
Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.