返回或设置指定段落的大纲级别。wdOutlineLevel,可读写。
可以是下列 WdOutlineLevel 常量之一:
wdOutLineLevel1
wdOutLineLevel2
wdOutLineLevel3
wdOutLineLevel4
wdOutLineLevel5
wdOutLineLevel6
wdOutLineLevel7
wdOutLineLevel8
wdOutLineLevel9
wdOutLineLevelBodyText.
expression.OutlineLevel
expression 必需。该表达式返回“应用于”列表中的一个对象。
如果一个段落具有标题样式(从“标题 1”到“标题 9”),则大纲级别与该标题样式相同,并且不能更改。
只能在大纲视图或文档结构图窗格中才能查看大纲级别。
本示例返回活动文档第一段的大纲级别。
temp = ActiveDocument.Paragraphs(1).OutlineLevel
本示例设置活动文档每一段的大纲级别。首先将正文样式应用于所有段落。Mod 操作符用来判定文档中的后继段落使用什么大纲级别(1、2 或 3),然后将视图切换至大纲视图。
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