Range
Overview
Range is a class in Aspose.Words FOSS for .NET.
Inherits from: IEnumerable<Node>.
Represents a contiguous area in a document.
This class provides 10 methods for working with Range objects in .NET programs.
Available methods include: Delete, GetEnumerator, NormalizeFieldTypes, Replace, ToDocument, UnlinkFields, UpdateFields.
All public members are accessible to any .NET application after installing the Aspose.Words FOSS for .NET package.
Properties: Bookmarks, Fields, FormFields, Revisions, StructuredDocumentTags, Text.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Text | string | Read | Gets the text of the range. |
FormFields | FormFieldCollection | Read | Returns a FormFields collection that represents all form fields in the range. |
Bookmarks | BookmarkCollection | Read | Returns a Bookmarks collection that represents all bookmarks in the range. |
Fields | FieldCollection | Read | Returns a Fields collection that represents all fields in the range. |
StructuredDocumentTags | StructuredDocumentTagCollection | Read | Returns a StructuredDocumentTags collection that represents all structured document tags in the range. |
Revisions | RevisionCollection | Read | Gets a collection of revisions (tracked changes) that exist in this range. |
Methods
| Signature | Description |
|---|---|
Delete() | Deletes all characters of the range. |
Replace(pattern: string, replacement: string) | Replaces all occurrences of a specified character string pattern with a replacement string. |
Replace(pattern: Regex, replacement: string) | Replaces all occurrences of a character pattern specified by a regular expression with another string. |
Replace(pattern: string, replacement: string, options: FindReplaceOptions) | Replaces all occurrences of a specified character string pattern with a replacement string. |
Replace(pattern: Regex, replacement: string, options: FindReplaceOptions) | Replaces all occurrences of a character pattern specified by a regular expression with another string. |
UpdateFields() | Updates the values of document fields in this range. |
UnlinkFields() | Unlinks fields in this range. |
NormalizeFieldTypes() | Changes field type values FieldType of FieldStart, FieldSeparator, FieldEnd in this range so that they correspond to the field types contained in the field codes. |
ToDocument() | Constructs a new fully formed document that contains the range. |
GetEnumerator() | Calls GetEnumerator on this Range instance. |