ProtectionType enumeration

ProtectionType enumeration

Protection type for a document.


ALLOW_ONLY_COMMENTSUser can only modify comments in the document.
ALLOW_ONLY_FORM_FIELDSUser can only enter data in the form fields in the document.
ALLOW_ONLY_REVISIONSUser can only add revision marks to the document.
READ_ONLYNo changes are allowed to the document. Available since Microsoft Word 2003.
NO_PROTECTIONThe document is not protected.


Shows how to turn off protection for a section.

doc = aw.Document()
builder = aw.DocumentBuilder(doc)
builder.writeln('Section 1. Hello world!')
builder.writeln('Section 2. Hello again!')
builder.write('Please enter text here: ')
builder.insert_text_input('TextInput1', aw.fields.TextFormFieldType.REGULAR, '', 'Placeholder text', 0)
# Apply write protection to every section in the document.
# Turn off write protection for the first section.
doc.sections[0].protected_for_forms = False
# In this output document, we will be able to edit the first section freely,
# and we will only be able to edit the contents of the form field in the second section. + 'Section.Protect.docx')

See Also