GetAllCaptionParagraphs

function GetAllCaptionParagraphs(sCaption: CaptionLabel | string = null): ApiParagraph[]

Description

Returns all caption paragraphs of the specified type from the current document.

Parameters

sCaptionCaptionLabel | stringdefault: null

The caption label ("Equation", "Figure", "Table", or another caption label).

Returns

ApiParagraph[]

Try It

var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
var oDrawing = Api.CreateImage("https://api.onlyoffice.com/content/img/docbuilder/examples/coordinate_aspects.png", 60 * 36000, 35 * 36000);
oParagraph.AddDrawing(oDrawing);
oParagraph = Api.CreateParagraph();
oDocument.Push(oParagraph);
oParagraph.AddCaption("", "Figure", false, "Arabic", false, undefined, "hyphen");
var aCaptionParagraphs = oDocument.GetAllCaptionParagraphs("Figure");
aCaptionParagraphs[0].SetCaps(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).