ListTemplates.Add Method (Word)
Returns a ListTemplate object that represents a new list template.
Syntax
expression .Add(OutlineNumbered, Name)
expression Required. A variable that represents a ListTemplates collection.
Parameters
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
OutlineNumbered |
Optional |
Variant |
True to apply outline numbering to the new list template. |
Name |
Optional |
Variant |
An optional name used for linking the list template to a LISTNUM field. You cannot use this name to index the list template in the collection. |
Return Value
ListTemplate
Remarks
You cannot use the Add method on ListTemplates objects returned from a ListGallery object. You can, however, modify the existing list templates in the galleries.
Example
This example adds a new, single-level list template to the active document. The example changes the numbering style for the new list template and then applies the list template to the selection.
Set myList = _
ActiveDocument.ListTemplates.Add(OutlineNumbered:=False)
myList.ListLevels(1).NumberStyle = wdListNumberStyleUpperCaseLetter
Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=myList