Section.ProtectedForForms Property
Gets or sets whether a section is protected for forms (section content is read-only except for form fields).
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v24.1.Core.dll
NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation
Declaration
Property Value
Type | Description |
---|---|
Boolean |
|
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 following code snippet 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;
using (var 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