Class UnprotectedRegion
Represents a region in a document that is exempt from protection.
Inheritance
Namespace: IronWord.Models
Assembly: IronWord.dll
Syntax
public class UnprotectedRegion : Object
Leaving a span of a locked Word document editable, while the rest stays protected, is described by UnprotectedRegion. Each region marks a stretch of content that readers may still change inside a file that is otherwise restricted, so a form or template can permit edits in known places only.
A region reaches the document through WordDocumentProtectionSettings, whose UnprotectedRegions property is a List<UnprotectedRegion>. Add the regions you want to leave open and they apply when the protected document is saved. Each region is pinned to the document by its boundaries: StartLocation and EndLocation are both ContentElement values that mark where the editable span begins and ends, and Identifier is a string name for the region so it can be referenced. Point the start and end at the elements that bracket the editable passage, give the region an identifier, and add it to the protection settings. Readers can then edit the content between those boundaries while the surrounding document remains locked. Use one region per editable span, and list several on the settings when a template opens more than one area.
The edit text how-to covers changing document content within editable regions, and the document element tutorial shows the element model that start and end locations point into.
Constructors
UnprotectedRegion()
Declaration
public UnprotectedRegion()
Properties
EndLocation
Gets or sets the end location of the region.
Declaration
public ContentElement EndLocation { get; set; }
Property Value
| Type | Description |
|---|---|
| ContentElement |
Identifier
Gets or sets the identifier or name of the region.
Declaration
public string Identifier { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
StartLocation
Gets or sets the start location of the region.
Declaration
public ContentElement StartLocation { get; set; }
Property Value
| Type | Description |
|---|---|
| ContentElement |