Class ListTemplates (Word VBA)

A collection of ListTemplate objects in a document, list gallery, or template. To use a ListTemplates class variable it first needs to be instantiated, for example


Dim lts as ListTemplates
Set lts = ActiveDocument.ListTemplates

For Each

Here is an example of processing the ListTemplates items in a collection.


Dim lte As ListTemplate
For Each lte In ActiveDocument.ListTemplates
	
Next lte

Add

Returns a ListTemplate object that represents a new list template.

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.

Add (OutlineNumbered, Name)


Set myList = _ 
 ActiveDocument.ListTemplates.Add(OutlineNumbered:=False) 
myList.ListLevels(1).NumberStyle = wdListNumberStyleUpperCaseLetter 
Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=myList

Arguments

Optional arguments

The following arguments are optional

OutlineNumbered (Boolean) - True to apply outline numbering to the new list template.

Name (String) - An optional name used for linking the list template to a LISTNUM field. You can use this name to index the list template in the collection.

Count

Returns a Long that represents the number of list templates in the collection.


Dim lngCount As Long
lngCount = ActiveDocument.ListTemplates.Count

Item

Returns an individual ListTemplate object in a collection.

Item (Index)

Index: The individual object to be returned. Can be a Long indicating the ordinal position or a String representing the name of the individual object.


Dim lte As ListTemplate
Set lte = ActiveDocument.ListTemplates(Index:=1)