Skip to main content

SetOutlineLvl

Sets the outline level for the specified properties.

Inherited from ApiParaPr.SetOutlineLvl.

Example

Get the outline level of the specified paragraph via paragraph properties in a document.

// How to set outline lvl for a paragraph properties in a document?

// Set outline lvl and display the result in a document.

const doc = Api.GetDocument();

const paragraph = doc.GetElement(0);
const paraPr = paragraph.GetParaPr();

const levelBefore = paraPr.GetOutlineLvl();
paraPr.SetOutlineLvl(8);
const levelAfter = paraPr.GetOutlineLvl();

let text = 'Outline level (index) for this paragraph is currently set to ' + levelAfter;
text += ',\nbut originally was set to ' + levelBefore;
paragraph.AddText(text);