GetParagraph

function GetParagraph(nPos: Number = null): ApiParagraph | "null"

Description

Returns a paragraph from all the paragraphs that are in the range.

Parameters

nPosNumberdefault: null

The paragraph position in the range.

Returns

ApiParagraph | "null"

Try It

var oDocument = Api.GetDocument();
var oFParagraph = oDocument.GetElement(0);
oFParagraph.AddText("First paragraph");
var oSParagraph = Api.CreateParagraph();
oSParagraph.AddText("Second Paragraph");
oDocument.Push(oSParagraph);
var oRange = oDocument.GetRange(0, 28);
var oRangeParagraph = oRange.GetParagraph(1);
oRangeParagraph.SetBold("true");

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).