Adds a text to the specified position.
Name | Type | Default | Description |
sText | String | The text that will be added. |
|
sPosition | string | "after" | The position where the text will be added ("before" or "after" the range specified). |
builder.CreateFile("docx"); 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"); builder.SaveFile("docx", "AddText.docx"); builder.CloseFile();