Range

Overview

Range is a class in Aspose.Words FOSS for Java. Inherits from: Iterable<Node>.

Represents a contiguous area in a document.

Edition status of its 19 listed members (a property and its accessor methods are listed separately, overloads once): 18 not yet exercised by a verified example.

This class declares 16 methods for Range objects in Java programs. Available methods include: delete, getBookmarks, getFields, getFormFields, getRevisions, getStructuredDocumentTags, getText, iterator, normalizeFieldTypes, replace, toDocument, unlinkFields, and 1 additional methods. Public members are accessible to any Java application after installing the Aspose.Words FOSS for Java package. Properties: bookmarks, fields, formFields, revisions, structuredDocumentTags, text.

Properties

NameTypeAccessDescription
textStringReadGets the text of the range.
formFieldsFormFieldCollectionReadReturns a FormFields collection that represents all form fields in the range.
bookmarksBookmarkCollectionReadReturns a Bookmarks collection that represents all bookmarks in the range.
fieldsFieldCollectionReadReturns a Fields collection that represents all fields in the range.
structuredDocumentTagsStructuredDocumentTagCollectionReadReturns a StructuredDocumentTags collection that represents all structured document tags in the range.
revisionsRevisionCollectionReadGets a collection of revisions (tracked changes) that exist in this range.

Methods

SignatureDescription
getText() → StringGets the text of the range.
getFormFields() → FormFieldCollectionReturns a FormFields collection that represents all form fields in the range.
getBookmarks() → BookmarkCollectionReturns a Bookmarks collection that represents all bookmarks in the range.
getFields() → FieldCollectionReturns a Fields collection that represents all fields in the range.
getStructuredDocumentTags() → StructuredDocumentTagCollectionReturns a StructuredDocumentTags collection that represents all structured document tags in the range.
delete()Deletes all characters of the range.
replace(pattern: String, replacement: String) → intReplaces all occurrences of a specified character string pattern with a replacement string.
replace(pattern: java.util.regex.Pattern, replacement: String) → intPerforms a regex replace across the range and returns the number of replacements made
replace(pattern: String, replacement: String, options: FindReplaceOptions) → intReplaces all occurrences of a specified character string pattern with a replacement string.
replace(pattern: java.util.regex.Pattern, replacement: String, options: FindReplaceOptions) → intCalls replace(pattern, replacement, options) on this Range instance.
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() → DocumentConstructs a new fully formed document that contains the range.
iterator() → Iterator<Node>Calls iterator on this Range instance.
getRevisions() → RevisionCollectionGets a collection of revisions (tracked changes) that exist in this range.

See Also