GetTagsOfAllContentControls

function GetTagsOfAllContentControls(): String[]

Description

Returns a list of all tags that are used for all content controls in the document.

Returns

String[]

Try It

var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
var oInlineLvlSdt = Api.CreateInlineLvlSdt();
oParagraph.AddInlineLvlSdt(oInlineLvlSdt);
oInlineLvlSdt.AddText("Inline content control");
oInlineLvlSdt.SetTag("Tag 1");
var oBlockLvlSdt = Api.CreateBlockLvlSdt();
oBlockLvlSdt.GetContent().GetElement(0).AddText("Block text content control");
oBlockLvlSdt.SetTag("Tag 2");
oDocument.AddElement(0, oBlockLvlSdt);
var aTags = oDocument.GetTagsOfAllContentControls();
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Content controls tags: ");
oParagraph.AddLineBreak();
for (let i = 0; i < aTags.length; i++ ){
   oParagraph.AddText(aTags[i]);
   oParagraph.AddLineBreak();
}
oDocument.Push(oParagraph);

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).