InsertParagraph
function InsertParagraph(
paragraph: string | ApiParagraph = null,
sPosition: string = null,
beRNewPara: boolean = null,
): ApiParagraph | "null"
Description
Inserts a paragraph at the specified position.
Parameters
Text or paragraph.
- sPosition
string
null The position where the text or paragraph will be inserted ("before" or "after" the paragraph specified).
- beRNewPara
boolean
null Defines if this method returns a new paragraph (true) or the current paragraph (false).
Returns
ApiParagraph | "null"
Try It
var oDocument = Api.GetDocument();
var oParagraph1 = oDocument.GetElement(0);
oParagraph1.AddText("This is just a sample text.");
var oParagraph2 = Api.CreateParagraph();
oParagraph2.AddText("This paragraph was inserted here.");
oParagraph1.InsertParagraph(oParagraph2, "after", true);