Class ListGallery (Word VBA)

The class ListGallery represents a single gallery of list formats. The ListGallery object is a member of the ListGalleries collection.


To use a ListGallery class variable it first needs to be instantiated, for example

Dim lgy as ListGallery
Set lgy = ListGalleries(Index:=1)

The following procedures can be used to set variables of type ListGallery: Application.ListGalleries and ListGalleries.Item

For Each

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

Dim lgy As ListGallery
For Each lgy In ListGalleries
Next lgy


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

Dim lngCount As Long
lngCount = ListGalleries.Count


Returns an individual ListGalleries object in a collection.

Syntax : expression.Item (Index)

Index: The individual object to be returned.

Dim lgy As ListGallery
Set lgy = ListGalleries(Index:=1)


Returns an object that represents the parent object of the specified ListGalleries object.

Dim objParent As Object
Set objParent = ListGalleries.Parent


Returns a ListTemplates collection that represents all the list formats for the specified list gallery.

For information about returning a single member of a collection, see Returning an object from a collection. The ListTemplates property is a member of the Document, ListGallery, and Template objects.

Set mytemp = ListGalleries(wdOutlineNumberGallery).ListTemplates(1) 
For each lev in mytemp.ListLevels 
 lev.NumberStyle = wdListNumberStyleLowercaseLetter 
Next lev 
ActiveDocument.Lists(2).ApplyListTemplate ListTemplate:=mytemp


True if the specified list template is not the built-in list template for that position in the list gallery.

Use the Reset method to set a list template in a list gallery back to the built-in list template.

Syntax : expression.Modified (Index)


Returns an object that represents the parent object of the specified ListGallery object.

Dim objParent As Object
Set objParent = ListGalleries(1).Parent


Resets the list template specified by Index for the specified list gallery to the built-in list template format.

Syntax : expression.Reset (Index)

Index: The template to reset.

Selection.Range.ListFormat.ApplyListTemplate _