VBA Code
What is a ListGallery
There are three types of list galleries in Word:
● wdBulletGallery - Single Level Bullets
● wdNumberGallery - Single Level Numbered
● wdOutlineNumberGallery - Multi-Level Numbering
ListGalleries are saved at both the application level and at the document level.
At the application level there can be only 7 different list templates for each of the 3 tabs.
Application.ListGalleries(wdListGalleryType.wdBulletGallery).ListTemplates
Application.ListGalleries(wdListGalleryType.wdNumberGallery).ListTemplates
Application.ListGalleries(wdListGalleryType.wdOutlineNumberGallery).ListTemplates
At the document (or template) level there can be any number of different list templates.
ActiveDocument.ListTemplates()
Single Level Bullets - wdBulletGallery
If Application.ListGalleries(wdListGalleryType.wdBulletGallery).Modified(1) = True Then
Application.ListGalleries(wdListGalleryType.wdBulletGallery).Reset 1
End If
Application.ListGalleries(wdListGalleryType.wdBulletGallery).Reset 7
This type of bullet only has Listlevel(1)
With Application.ListGalleries(wdListGalleryType.wdBulletGallery)
.ListTemplates(1).ListLevels(1).Font.Name = "Symbol"
.ListTemplates(1).ListLevels(1).NumberFormat = ChrW(61623)
.ListTemplates(1).ListLevels(1).NumberStyle = wdListNumberStyle.wdListNumberStyleBullet
.ListTemplates(2).ListLevels(1).Font.Name = "Courier New"
.ListTemplates(2).ListLevels(1).NumberFormat = "o"
.ListTemplates(3).ListLevels(1).Font.Name = "Wingdings"
.ListTemplates(3).ListLevels(1).NumberFormat = ChrW(61607)
.ListTemplates(4).ListLevels(1).ApplyPictureBullet FileName:=DefaultPictureBullet
'.ListTemplates(4).ListLevels(1).ApplyPictureBullet FileName:= "C:\Temp\my_image.bmp"
.ListTemplates(5).ListLevels(1).Font.Name = "Wingdings"
.ListTemplates(5).ListLevels(1).NumberFormat = ChrW(61558)
.ListTemplates(6).ListLevels(1).Font.Name = "Wingdings"
.ListTemplates(6).ListLevels(1).NumberFormat = ChrW(61656)
.ListTemplates(7).ListLevels(1).Font.Name = "Wingdings"
.ListTemplates(7).ListLevels(1).NumberFormat = ChrW(61692)
End With
Single Level Numbered - wdNumberGallery
If Application.ListGalleries(wdListGalleryType.wdNumberGallery).Modified(1) = True Then
Application.ListGalleries(wdListGalleryType.wdNumberGallery).Reset 1
End If
Application.ListGalleries(wdListGalleryType.wdNumberGallery).Reset 7
List Number - You can get the number that has been applied to any list-numbered paragraph using the ListString property
Selection.Paragraphs(1).Range.ListFormat.ListString
List Level - This means the level in a numbering outline. You can get the list level that has been applied to any list-numbered paragraph using the ListLevelNumber property
Selection.Paragraphs(1).Range.ListFormat.ListLevelNumber
A paragraph that has no list numbering applied to it returns 1 (instead of 0).
One way of distinguishing unnumbered from numbered paragraphs that genuinely have a list level of 1 is to check how many listparagraphs are in the current range
If Selection.Paragraphs(1).Range.ListParagraphs.Count = 1 Then
If (Selection.Paragraphs(1).Range.ListFormat.ListLevelNumber = 1) Then
'this is a genuine numbered paragraph
End If
End If
This type of bullet only has Listlevel(1)
With Application.ListGalleries(wdListGalleryType.wdBulletGallery)
.ListTemplates(1).ListLevels(1).NumberFormat = "%1."
.ListTemplates(1).ListLevels(1).NumberStyle = wdListNumberStyle.wdListNumberStyleArabic
.ListTemplates(2).ListLevels(1).NumberFormat = "%1)"
.ListTemplates(2).ListLevels(1).NumberStyle = wdListNumberStyle.wdListNumberStyleLowercaseLetter
.ListTemplates(3).ListLevels(1).NumberFormat = "%1."
.ListTemplates(3).ListLevels(1).NumberStyle = wdListNumberStyle.wdListNumberStyleUppercaseRoman
.ListTemplates(4).ListLevels(1).NumberFormat = "%1."
.ListTemplates(4).ListLevels(1).NumberStyle = wdListNumberStyle.wdListNumberStyleUppercaseLetter
.ListTemplates(5).ListLevels(1).NumberFormat = "%1)"
.ListTemplates(5).ListLevels(1).NumberStyle = wdListNumberStyle.wdListNumberStyleLowercaseLetter
.ListTemplates(6).ListLevels(1).NumberFormat = "%1."
.ListTemplates(6).ListLevels(1).NumberStyle = wdListNumberStyle.wdListNumberStyleLowercaseLetter
.ListTemplates(7).ListLevels(1).NumberFormat = "%1."
.ListTemplates(7).ListLevels(1).NumberStyle = wdListNumberStyle.wdListNumberStyleLowercaseRoman
End With
Multi-Level Numbering - wdOutlineNumberGallery
If Application.ListGalleries(wdListGalleryType.wdOutlineNumberGallery).Modified(1) = True Then
Application.ListGalleries(wdListGalleryType.wdOutlineNumberGallery).Reset 1
End If
Application.ListGalleries(wdListGalleryType.wdOutlineNumberGallery).Reset 9
With Application.ListGalleries(wdListGalleryType.wdOutlineNumberGallery)
.ListTemplates(1).ListLevels(1)
.ListTemplates(1).ListLevels(2)
.ListTemplates(1).ListLevels(3)
.ListTemplates(1).ListLevels(4)
.ListTemplates(1).ListLevels(5)
.ListTemplates(1).ListLevels(6)
.ListTemplates(1).ListLevels(7)
.ListTemplates(1).ListLevels(8)
.ListTemplates(1).ListLevels(9)
End With
.TrailingCharacter = wdTrailingCharacter.wdTrailingTab
.NumberPosition = CentimetersToPoints(0)
.Alignment = wdListLevelAlignment.wdListLevelAlignLeft
.TextPosition = CentimetersToPoints(1)
.TabPosition = CentimetersToPoints(2)
.ResetOnHigher = 0
.StartAt = 1
.LinkedStyle = "Date"
Selection.Range.ListFormat.ListType = wdListType.wdListBullet
Outline Numbering
Selection.Paragraphs(1).OutlineLevel
Dim oListFormat As ListFormat
Dim oListTemplate As ListTemplate
Dim oListLevel As ListLevel
Set oListFormat = Selection.Paragraphs(1).Range.ListFormat
'Debug.Print oListFormat.ListLevelNumber
'Debug.Print oListFormat.ListString
Set oListTemplate = oListFormat.ListTemplate
'Debug.Print oListTemplate.ListLevels.Count
Set oListLevel = oListTemplate.ListLevels.Item(oListFormat.ListLevelNumber)
Debug.Print oListLevel.NumberStyle = wdListNumberStyleBullet
Debug.Print oListLevel.Font.Name
Debug.Print oListLevel.NumberFormat
Debug.Print oListLevel.NumberPosition
Stop
Debug.Print Application.ListGalleries(wdBulletGallery).ListTemplates.Count
Stop
List Object
Represents a single list format that's been applied to specified paragraphs in a document.
These paragraphs do not have to be consecutive.
The List object is a member of the Lists collection.
If the first paragraph in the range for the ListFormat object is not formatted as a list, the List property returns nothing.
The following example returns the number of items in list one in the active document.
itotal = ActiveDocument.Lists(1).CountNumberedItems
To return all the paragraphs that have list formatting, use the ListParagraphs property
To return them as a range, use the Range property.
To apply a different list format to an existing list, use the ApplyListTemplate method with the List object.
To add a new list to a document, use the ApplyListTemplate method with the ListFormat object for a specified range.
Use the CanContinuePreviousList method to determine whether you can continue the list formatting from a list that was previously applied to the document.
Use the CountNumberedItems method to return the number of items in a numbered or bulleted list, including LISTNUM fields.
To determine whether a list contains more than one list template, use the SingleListTemplate property.
You can manipulate the individual List objects within a document, but for more precise control you should work with the ListFormat object.
Picture-bulleted lists are not included in the Lists collection and cannot be manipulated using the List object.
This example returns the first list in the selection, and then it applies the first list template (excluding None) on the Numbered tab in the Bullets and Numbering dialog box (Format menu). The selection can only contain one list.
Set mylist = Selection.Range.ListFormat.List
mylist.ApplyListTemplate ListTemplate:=ListGalleries(wdListGalleryType.wdNumberGallery).ListTemplates(1)
What is a List Style ?
A list style is a group of paragraph styles that are organised into 9 different levels.
List styles will not appear (or be displayed) in any drop-downs or task panes
The only place they appear is at the bottom of the Multi-Level List drop-down on the Home tab
ActiveDocument.Styles("MyListStyle").LinkToListTemplate ListTemplate:=oLTemplate, ListLevelNumber:=1
ListFormat Object
Represents the list formatting attributes that can be applied to the paragraphs in a range.
ListFormat Property
Returns a ListFormat object that represents all the list formatting characteristics of a range. Read-only.
Use the List or ListTemplate property to return the list or list template from the first paragraph in the specified range.
Use the ListFormat property to return the ListFormat object for a range.
The following example applies the default bulleted list format to the selection.
Selection.Range.ListFormat.ApplyBulletDefault
Use the ListFormat property with a Range object to access the list formatting properties and methods available for the specified range.
This example sets the variable myDoc to a range that includes paragraphs three through six of the active document.
The example then either applies the default outline-numbered list format to the range or removes it, depending on whether or not the format was already applied to the range.
Set myDoc = ActiveDocument
Set myRange = _
myDoc.Range(Start:= myDoc.Paragraphs(3).Range.Start, _
End:=myDoc.Paragraphs(6).Range.End)
myRange.ListFormat.ApplyOutlineNumberDefault
This example applies the second list template on the Numbered tab in the Bullets and Numbering dialog box to all the paragraphs in the selection.
Selection.Range.ListFormat.ApplyListTemplate _
ListTemplate:=ListGalleries(wdListGalleryType.wdNumberGallery).ListTemplates(2)
The following example applies the default bullet list format to the second paragraph in the active document.
ActiveDocument.Paragraphs(2).Range.ListFormat.ApplyBulletDefault
However, if there's already a list defined in your document, you can access a List object by using the Lists property.
The following example changes the format of the list created in the preceding example to the first number format on the Numbered tab in the Bullets and Numbering dialog box.
ActiveDocument.Lists(1).ApplyListTemplate ListTemplate:=ListGalleries(2).ListTemplates(1)
ListTemplate Object
A list template object represents a list template and specifies all the formatting for a specific bullet format.
There are three collections that have a ListTemplates collection
(1) Document
(2) Template
(3) ListGallery
An easy way to apply list formatting is to use the ApplyBulletDefault, ApplyNumberDefault, and ApplyOutlineNumberDefault methods, which correspond, respectively, to the first list format (excluding None) on each tab in the Bullets and Numbering dialog box.
To apply a format other than the default format, use the ApplyListTemplate method, which allows you to specify the list format (list template) you want to apply.
ListTemplates Collection
Every document (or template) has a ListTemplates collection.
This collection represents all the list formats contained in that document.
ActiveDocument.ListTemplates
Sub Create_ListTemplate()
Dim oLTemplate As ListTemplate
Set oLTemplate = ActiveDocument.ListTemplates.Add(False, "MyListTemplate")
oLTemplate.ListLevels(1)
Set oLTemplate = ActiveDocument.ListTemplates.Add(True, "MyListTemplate")
oLTemplate.ListLevels(1)
oLTemplate.ListLevels(2)
oLTemplate.ListLevels(3)
End Sub
ListLevel Object
Each ListTemplate object has a collection of ListLevel objects.
The ListLevel object is the object that defines the actual formatting of the ListTemplate object.
For single level formats the ListLevels collection only contains a single ListLevel object.
A multi level list may contain up to nine levels.
listlevel = ActiveDocument.Paragraphs(2).Range.ListFormat.ListLevelNumber
Does changing "the number style for this level" to (none) - make the level hidden
List Level means the level in a numbering outline: so in Figure 1, the first and last paragraphs would have no list level, and the middle two would usually have list levels of 1 and 2 respectively.
You can get the list level that has been applied to any list-numbered paragraph using the ListLevelNumber property; for example:
MsgBox Selection.Paragraphs(1).Range.ListFormat.ListLevelNumber
A paragraph that has no list numbering applied returns 1 - whereas it really ought to return nothing or 0, or 10, or 9999, or something that indicates that it has no List Level - but certainly not 1. This is a bug. So to distinguish unnumbered paragraphs from paragraphs which genuinely have a List Level of 1, you have to use something like:
If Selection.Paragraphs(1).Range.ListParagraphs.Count = 1Then
MsgBox Selection.Paragraphs(1).Range.ListFormat.ListLevelNumber
Else
MsgBox "Not a numbered paragraph"
End If
© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrev