ListFormat 对象

         
Range
ListFormat
多种对象

代表可用于某一区域中各段落的列表格式属性。

使用 ListFormat 对象

ListFormat 属性可为某一区域返回一个 ListFormat 对象。下列示例为选定内容添加默认的项目符号列表格式。

Selection.Range.ListFormat.ApplyBulletDefault

应用列表模板

设置列表格式的方便途径是采用 ApplyBulletDefaultApplyNumberDefaultApplyOutlineNumberDefault 方法。各方法分别对应于“项目符号和编号”对话框中各选项卡上的第一种列表格式(不包括“无”)。

要应用默认格式以外的其他格式,可用 ApplyListTemplate 方法指定所需的列表格式。

返回列表或列表模板

ListListTemplate 属性可从指定区域中的第一段返回列表或列表模板。

说明

Range 对象的 ListFormat 属性可访问所指定区域中有效的列表格式属性和方法。下列示例为活动文档中的第二段设置默认的项目符号列表格式。

ActiveDocument.Paragraphs(2).Range.ListFormat.ApplyBulletDefault

但是,如果文档中已存在列表,则可用 Lists 属性访问 List 对象。下列示例将上例中创建的列表格式改为“项目符号和编号”对话框中“编号”选项卡上的第一种编号格式。

ActiveDocument.Lists(1).ApplyListTemplate _
    ListTemplate:=ListGalleries(2).ListTemplates(1)