Skip to main content

GetOutlineLvl

Returns the outline level of the specified properties.

Inherited from ApiParaPr.GetOutlineLvl.

Example

Set and get the outline level of the specified paragraph via paragraph properties in a spreadsheet.

// How to get the outline lvl for a paragraph properties in a spreadsheet?

// Get the outline lvl and display the result in a spreadsheet.

const worksheet = Api.GetActiveSheet();

const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const fill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
const shape = worksheet.AddShape("flowChartOnlineStorage", 120 * 36000, 70 * 36000, fill, stroke, 0, 2 * 36000, 0, 3 * 36000);

const content = shape.GetContent();
const paragraph = content.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);