ExpandOutline 方法

       

将选定内容或指定范围内的正文展开一个标题级别。

注意   如果文档未处于大纲或主控文档视图,将导致出错。

expression.ExpandOutline(Range)

expression   必需。该表达式返回一个 View 对象。

Range   Range 对象类型,可选。指定展开的段落范围。如果省略此参数,则展开全部选定内容。

示例

本示例将文档中每个标题展开一个级别。

With ActiveDocument.ActiveWindow.View
    .Type = wdOutlineView
    .ExpandOutline Range:=ActiveDocument.Content
End With

本示例展开 Document2 窗口中的活动段落。

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