Skip to main content
A newer version of this page is available. .

RichEditDocument Class

Defines a document in the Rich Text Editor.

Declaration

export class RichEditDocument extends RichEditDocumentBase

Inheritance

RichEditDocumentBase
RichEditDocument

Properties

bookmarks Property

Provide access to the document’s collection of bookmarks.

Declaration

readonly bookmarks: BookmarkCollectionBase

Property Value

Type Description
BookmarkCollectionBase

A collection of bookmarks.

Remarks

richEdit.document.bookmarks.find("bookmarkName")[0].goTo();
See Also

fields Property

Provide access to the document’s collection of fields.

Declaration

readonly fields: FieldCollection

Property Value

Type Description
FieldCollection

A collection of fields.

Remarks

//Gets all fields in the main sub-document
var mainSubDocumentFields = richEdit.document.fields;
See Also

Provide access to the document’s collection of hyperlinks.

readonly hyperlinks: HyperlinkCollection
Type Description
HyperlinkCollection

A collection of hyperlinks.

//Gets URLs of all hyperlinks in the main sub-document
var hyperlinks = richEdit.document.hyperlinks;
var hyperlinkUrls = [];
for(var i = 0, hyperlink; hyperlink = hyperlinks.getByIndex(i); i++)
    if(hyperlink.hyperlinkInfo.url)
        hyperlinkUrls.push(hyperlink.hyperlinkInfo.url);
See Also

modified Property

Specifies whether the document has unsaved changes.

Declaration

modified: boolean

Property Value

Type Description
boolean

true, if the document has unsaved changes; otherwise, false.

subDocuments Property

Provide access to the document’s collection of sub-documents.

Declaration

readonly subDocuments: SubDocumentsCollectionBase

Property Value

Type Description
SubDocumentsCollectionBase

A collection of sub-documents.

tables Property

Provide access to the document’s collection of tables.

Declaration

readonly tables: TableCollectionBaseApi

Property Value

Type Description
TableCollectionBaseApi

A collection of tables.

Remarks

richEdit.document.tables.create(tblPosition,2,3);
See Also

Methods

setDefaultCharacterProperties(characterProperties) Method

Sets the document’s default character properties.

Declaration

setDefaultCharacterProperties(
    characterProperties: CharacterProperties
): void

Parameters

Name Type Description
characterProperties CharacterProperties

An object that contains the applied character properties.

Remarks

const charProps = rich.document.getDefaultCharacterProperties();
charProps.fontName = "Segoe UI"
richEdit.document.setDefaultCharacterProperties(charProps);