@tahir.manzoor
In my document each section is content control. And I am using protection type read only (contentDoc.protect(ProtectionType.READ_ONLY)) for current document.
Now I want text of a particular section to be editable.
for your Ref. PFA.
I want highlighted text should be editable.
But in my case whole document is non-editable.
image.png (15.1 KB)
Document contentDoc = new Document(Teste.class.getResourceAsStream(“originaldocx”));
contentDoc.protect(ProtectionType.READ_ONLY);
DocumentBuilder builder = new DocumentBuilder(contentDoc);
for(Section section: contentDoc.getSections()){
section.setProtectedForForms(false);
builder.moveToSection(contentDoc.indexOf(section));
builder.moveTo(section.getBody().getFirstChild());
EditableRangeStart s = builder.startEditableRange();
builder.moveTo(section.getBody().getLastChild());
builder.endEditableRange(s);