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

Free Support Forum - aspose.com

DocumentProtection.Edit equivalent API in Aspose.Words for Java


how can I access this OpenXml.Wordprocessing.DocumentProtection.Edit with Aspose for Word Java to set his value?

Thank you!


Please read the following article about protecting and unprotecting documents
Protecting Documents

Moreover, the EditableRange class represents a single editable range. EditableRange is a “facade” object that encapsulates two nodes EditableRangeStart and EditableRangeEnd in a document tree and allows to work with an editable range as a single object.

You need to add EditableRangeStart and EditableRangeEnd nodes into document that you want to edit and protect the document using Document.Protect method.

Following code example shows how to make the document as read only except the second paragraph.

Document doc = new Document(MyDir + "in.docx");

DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToParagraph(1, 0);
builder.MoveToParagraph(1, -1);

doc.Save(MyDir + "Out.docx");