create a .doc file.
when open it is read-only by default. if we click on any text and type some character MS Word will ask for a password to edit.
how to do this using ASPOSE.Words?
create a .doc file.
when open it is read-only by default. if we click on any text and type some character MS Word will ask for a password to edit.
how to do this using ASPOSE.Words?
You can use the following overload of Protect method:
Document doc = new Document("E:\\temp\\input.docx");
doc.Protect(ProtectionType.ReadOnly, "password");
doc.Save("E:\\temp\\19.2.docx");
Also, in order to save document with encryption please use the following code snippet:
Document doc = new Document("E:\\Temp\\input.docx");
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions();
saveOptions.Password = "myPassword";
doc.Save("E:\\Temp\\out.docx", saveOptions);
Hope, this helps.