Paragraph.OutlineLevel property (Word)

Returns or sets the outline level for the specified paragraph. Read/write WdOutlineLevel.

Syntax

expression.OutlineLevel

expression Required. A variable that represents a 'Paragraph' object.

Remarks

If a paragraph has a heading style applied to it (Heading 1 through Heading 9), the outline level is the same as the heading style and cannot be changed. Outline levels are visible only in outline view or the document map pane.

Example

This example returns the outline level of the first paragraph in the active document.

temp = ActiveDocument.Paragraphs(1).OutlineLevel

This example sets the outline level for each paragraph in the active document. First the Normal style is applied to all paragraphs. The Mod operator is used to determine which outline level (1, 2, or 3) to apply to successive paragraphs in the document, and then the view is changed to outline view.

Set myParas = ActiveDocument.Paragraphs 
ActiveDocument.Paragraphs.Style = wdStyleNormal 
For x = 1 To myParas.Count 
 If x Mod 3 = 1 Then 
 myParas(x).OutlineLevel = wdOutlineLevel1 
 ElseIf x Mod 3 = 2 Then 
 myParas(x).OutlineLevel = wdOutlineLevel2 
 Else 
 myParas(x).OutlineLevel = wdOutlineLevel3 
 End If 
Next x 
ActiveDocument.ActiveWindow.View.Type = wdOutlineView

See also

Paragraph Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.