GetAllStyles

function GetAllStyles(): ApiStyle[]

Description

Returns all styles of the current document.

Returns

ApiStyle[]

Try It

var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("Document styles:");
oParagraph.SetBold(true);
var aStyles = oDocument.GetAllStyles();
for (let i = 0; i < aStyles.length; i++ ){
   oParagraph = Api.CreateParagraph();
   oParagraph.AddText(aStyles[i].GetName());
   oDocument.AddElement(i + 1, 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).