返回或设置指定列表级别的数字格式。String 类型,可读写。
expression.NumberFormat
expression 必需。该表达式返回一个 ListLevel 对象。
百分号 (%) 后接从 1 到 9 的任何数字代表不同级别的编号样式。例如,如果要将第一级设为“Article I”,第二级设为“Article II”,以此类推,则可使 NumberFormat 属性的字符串为“Article %1”,将 NumberStyle 属性设置为 wdListNumberStyleUpperCaseRoman。
如果将 NumberStyle 属性设置为 wdListNumberStyleBullet,则 NumberFormat 属性的字符串只能包含一个字符。
本示例创建一个列表模板,该模板各级依次缩进,并用阿拉伯数字和句点设置各级的格式,再将新的列表模板应用于所选内容。
Set LT = ActiveDocument.ListTemplates.Add(OutlineNumbered:=True)
For x = 1 To 9
With LT.ListLevels(x)
.NumberStyle = wdListNumberStyleArabic
.NumberPosition = InchesToPoints(0.25 * (x - 1))
.TextPosition = InchesToPoints(0.25 * x)
.NumberFormat = "%" & x & "."
End With
Next x
Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=LT