O'Reilly logo

Writing Word Macros, Second Edition by Steven Roman PhD

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The ListTemplate Object and ListGalleries

The ListTemplate object represents a list template, which is an object that specifies all the formatting that defines a list. ListTemplates are kept in a ListTemplates collection.

There are three Word objects that have a ListTemplates property that returns a ListTemplates collection: Document objects, Template objects, and ListGallery objects. In other words, ListTemplate objects can be stored in any of these three objects.

ListGallery Objects

One place to keep a ListTemplate object is in a ListGallery object. There are three ListGallery objects representing the three tabs in the Bullets and Numbering dialog box. The collection of these three ListGallery objects is the ListGalleries collection.

In fact, Word supplies an enum to use as the index for the ListGalleries collection:

	Enum WdListGalleryType
	   wdBulletGallery = 1
	   wdNumberGallery = 2
	   wdOutlineNumberGallery = 3
	End Enum

Thus, for instance:

	ListGalleries(wdNumberGallery)

is the second ListGallery object and represents the second tab in the Bullets and Numbering dialog box. Note that the type of the ListGallery object determines the type of ListTemplate objects that can be placed in that ListGallery’s ListTemplates collection. For instance, the list templates in ListGalleries(wdNumberGallery) must be single-level numbered list formats.

The ListGallery object has the following properties and methods (among others):

The ListTemplates property

Returns a ListTemplates collection that represents ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required