ExpandOutline Method

Applies To

View object.

Description

Expands the text under the selection or the specified range by one heading level.

Note If the document isn't in outline or master document view, an error occurs.

Syntax

expression.ExpandOutline(Range)

expression Required. An expression that returns a View object.

Range Optional Range object. The range of paragraphs to be expanded. If this argument is omitted, the entire selection is expanded.

See Also

CollapseOutline method.

Example

This example expands every heading in the document by one level.

With ActiveWindow.View
    .Type = wdOutlineView
    .ExpandOutline Range:=ActiveDocument.Content
End With
This example expands the active paragraph in the Document2 window.

With Windows("Document2")
    .Activate
    .View.Type = wdOutlineView
    .View.ExpandOutline
End With