ListTemplate 对象(Word)ListTemplate object (Word)

代表单个列表模板,其中包含用于定义列表的所有格式。Represents a single list template that includes all the formatting that defines a list. ListTemplate对象是ListTemplates集合的一个成员。The ListTemplate object is a member of the ListTemplates collection.

备注Remarks

在 "项目符号和编号" 对话框中的三个选项卡上,找到的七种格式(不包括 "")中的每一个都对应一个列表模板对象。Each of the seven formats (excluding None) found on each of the three tabs in the Bullets and Numbering dialog box corresponds to a list template object. 通过 ListGalleries 集合中的三个 ListGallery 对象可以访问这些预定义的列表模板。These predefined list templates can be accessed from the three ListGallery objects in the ListGalleries collection. 文档和模板也可以包含列表模板的集合。Documents and templates can also contain collections of list templates.

使用ListTemplates (索引),其中索引是从1到7的数字,从列表库中返回单个列表模板。Use ListTemplates (Index), where Index is a number from 1 through 7, to return a single list template from a list gallery. 以下示例返回 “项目符号和编号” 对话框中 “编号” 选项卡上的第三种列表格式(不包括 “无”)。The following example returns the third list format (excluding None) on the Numbered tab in the Bullets and Numbering dialog box.

Set temp3 = ListGalleries(2).ListTemplates(3)

备注

某些属性和方法(例如,转换添加)不会与从列表库中访问的列表模板一起使用。Some properties and methods — Convert and Add, for example — won't work with list templates that are accessed from a list gallery. 您可以修改这些列表模板,但不能改变它们的列表库类型(wdBulletGallerywdNumberGallerywdOutlineNumberGallery)。You can modify these list templates, but you cannot change their list gallery type (wdBulletGallery, wdNumberGallery, or wdOutlineNumberGallery).

下面的示例将一个对象变量等于活动文档中的第三个列表中使用的列表模板,然后将该列表模板应用于所选内容。The following example sets an object variable equal to the list template used in the third list in the active document, and then it applies that list template to the selection.

Set myLt = ActiveDocument.ListTemplates(3) 
Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=myLt

使用add方法可将列表模板添加到文档或模板中的列表模板集合中。Use the Add method to add a list template to the collection of list templates in a document or template.

若要查看指定的列表模板是否包含 Word 内置的格式设置,使用 ListGallery 对象中的 修改时间 属性。To see whether the specified list template contains the formatting built into Word, use the Modified property with the ListGallery object. 若要重置为原始列表格式的格式,请使用 ListGallery 对象的 Reset 方法。To reset formatting to the original list format, use the Reset method for the ListGallery object.

返回ListTemplate对象后,请使用ListLevels (Index),其中索引是从1到9的数字,返回单个ListLevel对象。After you have returned a ListTemplate object, use ListLevels (Index), where Index is a number from 1 through 9, to return a single ListLevel object. ListLevel 对象时,您有权访问指定的列表级别,如 对齐方式字体NumberFormatNumberPositionTrailingCharacter 格式的所有属性。With a ListLevel object, you have access to all the formatting properties for the specified list level, such as Alignment, Font, NumberFormat, NumberPosition, NumberStyle, and TrailingCharacter.

使用 转换 方法将多级列表模板转换为单级模板。Use the Convert method to convert a multiple-level list template to a single-level template.

方法Methods

名称Name
ConvertConvert

属性Properties

名称Name
ApplicationApplication
CreatorCreator
ListLevelsListLevels
NameName
OutlineNumberedOutlineNumbered
ParentParent

另请参阅See also

Word 对象模型参考Word Object Model Reference

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.