Skip to main content
All docs
V23.2

Section.ProtectedForForms Property

Gets or sets whether the section is protected for forms (section content is read-only except for form fields).

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v23.2.Core.dll

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

Declaration

bool ProtectedForForms { get; set; }

Property Value

Type Description
Boolean

true if the section is protected for forms; otherwise, false.

Remarks

When a section is protected, you can modify text only in form fields. To protect an entire document, use the Document.Protect method.

Example

The code snippet below loads a document with two sections, turns on form protection for the first section in the document, unprotects the second section, and saves the updated document.

using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

RichEditDocumentServer wordProcessor = new RichEditDocumentServer();
wordProcessor.LoadDocument(@"C:\DocumentWithTwoSections.docx", DocumentFormat.OpenXml);
wordProcessor.Document.Sections[0].ProtectedForForms = true;
wordProcessor.Document.Sections[1].ProtectedForForms = false;
wordProcessor.Document.Protect("", DocumentProtectionType.FillInForms);
wordProcessor.SaveDocument("DocumentWithTwoSectionsProtected.docx", DocumentFormat.OpenXml);
See Also