InsertRtfCommand.execute(rtfText, position) Method
In This Article
Executes the InsertRtfCommand command with the specified parameters.
#Declaration
TypeScript
execute(
rtfText: string,
position: number,
subDocumentId?: number,
callback?: (interval: Interval,
isRtfValid: boolean) => void
): boolean
#Parameters
Name | Type | Description |
---|---|---|
rtf |
string | A string representing the RTF formatted content to insert. |
position | number | The position to insert in the specified sub-document. |
sub |
number | A value identifying the target sub-document. |
callback | (interval: Interval, is |
A callback function that passes the inserted content’s Interval object and the bool parameter that displays whether the RTF formatted string is valid. |
#Returns
Type | Description |
---|---|
boolean |
|
#Remarks
Usage example:
var insertPosition = 2;
var subDocumentId = richEdit.document.mainSubDocument.id;
var callbackFunc = function (interval, isRtfValid) {}
richEdit.commands.insertRtf.execute(RTFstring, insertPosition, subDocumentId, callbackFunc);
See Also