InsertContent
function InsertContent(
arrContent: DocumentElement[] = null,
isInline: boolean = false,
oPr: object = null,
): boolean
Description
Inserts an array of elements into the current position of the document.
Parameters
An array of elements to insert.
- isInline
boolean
false Inline insert or not (works only for the last and the first element and only if it's a paragraph).
- oPr
object
null Specifies that text and paragraph document properties are preserved for the inserted elements. The object should look like this: {"KeepTextOnly": true}.
Returns
boolean
Try It
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph = Api.CreateParagraph();
oParagraph.AddText("This is a sample text. It was inserted here.");
oDocument.InsertContent([oParagraph]);