AddText
function AddText(sText: String = null, sPosition: string = "after"): boolean
Description
Adds a text to the specified position.
Parameters
- sText
String
null The text that will be added.
- sPosition
string
"after" The position where the text will be added ("before" or "after" the range specified).
Returns
boolean
Try It
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("Document");
var oRange = oDocument.GetRange(0, 7);
oRange.AddText("ONLYOFFICE ", "before");
oRange.AddText(" Builder", "after");