OutlineLevel enumeration

OutlineLevel enumeration

Specifies the outline level of a paragraph in the document.

Members

NameDescription
LEVEL1The paragraph is at the outline level 1 (topmost level).
LEVEL2The paragraph is at the outline level 2.
LEVEL3The paragraph is at the outline level 3.
LEVEL4The paragraph is at the outline level 4.
LEVEL5The paragraph is at the outline level 5.
LEVEL6The paragraph is at the outline level 6.
LEVEL7The paragraph is at the outline level 7.
LEVEL8The paragraph is at the outline level 8.
LEVEL9The paragraph is at the outline level 9.
BODY_TEXTThe paragraph is at the level of the main text.

Examples

Shows how to configure paragraph outline levels to create collapsible text.

doc = aw.Document()
builder = aw.DocumentBuilder(doc=doc)
# Each paragraph has an OutlineLevel, which could be any number from 1 to 9, or at the default "BodyText" value.
# Setting the property to one of the numbered values will show an arrow to the left
# of the beginning of the paragraph.
builder.paragraph_format.outline_level = aw.OutlineLevel.LEVEL1
builder.writeln('Paragraph outline level 1.')
# Level 1 is the topmost level. If there is a paragraph with a lower level below a paragraph with a higher level,
# collapsing the higher-level paragraph will collapse the lower level paragraph.
builder.paragraph_format.outline_level = aw.OutlineLevel.LEVEL2
builder.writeln('Paragraph outline level 2.')
# Two paragraphs of the same level will not collapse each other,
# and the arrows do not collapse the paragraphs they point to.
builder.paragraph_format.outline_level = aw.OutlineLevel.LEVEL3
builder.writeln('Paragraph outline level 3.')
builder.writeln('Paragraph outline level 3.')
# The default "BodyText" value is the lowest, which a paragraph of any level can collapse.
builder.paragraph_format.outline_level = aw.OutlineLevel.BODY_TEXT
builder.writeln('Paragraph at main text level.')
doc.save(file_name=ARTIFACTS_DIR + 'ParagraphFormat.ParagraphOutlineLevel.docx')

See Also