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

InsertTextCommand.execute(text) Method

Executes the InsertTextCommand command with the specified parameters.

Declaration

execute(
    text: string,
    interval?: Interval | number,
    subDocumentId?: number
): boolean

Parameters

Name Type Description
text string

A string value specifying a text to insert.

interval Interval | number
subDocumentId number

An integer value specifying the sub-document.

Returns

Type Description
boolean

true if the command has been successfully executed; false if the command execution has failed.

Remarks

Note that this method does not change the selection

//Inserts a text at the end of the active sub-document
richEdit.selection.goToDocumentEnd();
richEdit.commands.insertText.execute("sometext");

If you need to access a header/footer sub-document, you can use the Section‘s Section.headers and Section.footers members. A document’s sections are available via the RichEditDocument.sectionsInfo property.

See Also