ListFormat.ApplyNumberDefault 方法 (Word)ListFormat.ApplyNumberDefault method (Word)

添加默认的编号段落中指定的ListFormat对象的范围。Adds the default numbering scheme to the paragraphs in the range for the specified ListFormat object.

语法Syntax

expressionexpression. ApplyNumberDefault( _DefaultListBehavior_ )

expression:必需。expression Required. 代表ListFormat对象的变量。A variable that represents a 'ListFormat' object.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
DefaultListBehaviorDefaultListBehavior 可选Optional VariantVariant 设置一个值,指定是否 Microsoft Word 使用新的面向 Web 的格式更好的列表中显示。Sets a value that specifies whether Microsoft Word uses new Web-oriented formatting for better list display. 可以是以下常量之一: wdWord8ListBehavior (使用与 Microsoft Word 97 兼容的格式) 或wdWord9ListBehavior (使用面向 Web 的格式)。Can be either of the following constants: wdWord8ListBehavior (use formatting compatible with Microsoft Word 97) or wdWord9ListBehavior (use Web-oriented formatting). 兼容性原因,采用默认常量wdWord8ListBehavior ,但您应使用wdWord9ListBehavior充分利用相对于缩进和多级面向网站的格式改进的新过程中列出。For compatibility reasons, the default constant is wdWord8ListBehavior , but in new procedures you should use wdWord9ListBehavior to take advantage of improved Web-oriented formatting with respect to indenting and multilevel lists.

注解Remarks

如果段落已设置了编号列表格式,该方法将清除其中已有的编号和格式。If the paragraphs are already formatted as a numbered list, this method removes the numbers and formatting.

示例Example

本示例选定内容中的段落进行编号。This example numbers the paragraphs in the selection. 如果所选内容已编号的列表,该示例将删除数字和格式。If the selection is already a numbered list, the example removes the numbers and formatting.

Selection.Range.ListFormat.ApplyNumberDefault

本示例将变量 myRange 设置为包括活动文档中第三段到第六段的一个区域,然后检查该区域内是否包含列表格式。This example sets the variable myRange to include paragraphs three through six of the active document, and then it checks to see whether the range contains list formatting. 如果没有任何列表格式,默认的编号应用于范围。If there is no list formatting, default numbers are applied to the range.

Set myDoc = ActiveDocument 
Set myRange = myDoc.Range( _ 
 Start:= myDoc.Paragraphs(3).Range.Start, _ 
 End:=myDoc.Paragraphs(6).Range.End) 
If myRange.ListFormat.ListType = wdListNoNumbering Then 
 myRange.ListFormat.ApplyNumberDefault 
End If

另请参阅See also

ListFormat 对象ListFormat Object