officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-field-554f642b.md
Returns the document range the field occupies.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
DocumentRange Range { get; }
ReadOnly Property Range As DocumentRange
| Type | Description |
|---|---|
| DocumentRange |
The document range that contains the field (including its code and result).
|
Use the Field.CodeRange property to obtain the field code’s range, and the Field.ResultRange property to retrieve the field result’s range.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Range property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-richedit-table-of-contents-practical-guide/CS/Form1.cs#L93
Field field = Document.Fields.Create(Document.Paragraphs[(insertHeading ? 1 : 0)].Range.Start, "TOC " + switches);
CharacterProperties cp = Document.BeginUpdateCharacters(field.Range);
cp.Bold = false;
winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Export.cs#L88
exportOptions.FieldResultEndMarker = "]";
plainText = document.GetText(item.Range, exportOptions);
}
word-processing-table-of-contents-practical-guide/CS/Program.cs#L125
Field field = document.Fields.Create(document.Paragraphs[(insertHeading ? 1 : 0)].Range.Start, "TOC " + switches);
CharacterProperties cp = document.BeginUpdateCharacters(field.Range);
cp.Bold = false;
winforms-richedit-table-of-contents-practical-guide/VB/Form1.vb#L85
Dim field As Field = Document.Fields.Create(Document.Paragraphs(If(insertHeading, 1, 0)).Range.Start, "TOC " & switches)
Dim cp As CharacterProperties = Document.BeginUpdateCharacters(field.Range)
cp.Bold = False
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Export.vb#L78
exportOptions.FieldResultEndMarker = "]"
plainText = document.GetText(item.Range, exportOptions)
End If
word-processing-table-of-contents-practical-guide/VB/Program.vb#L122
Dim field As Field = document.Fields.Create(document.Paragraphs(If(insertHeading, 1, 0)).Range.Start, "TOC " & switches)
Dim cp As CharacterProperties = document.BeginUpdateCharacters(field.Range)
cp.Bold = False
See Also