Class List (Word VBA)

The class List represents a single list format that's been applied to specified paragraphs in a document. The List object is a member of the Lists collection.

Set

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

Dim lst as List
Set lst = ActiveDocument.Lists(Index:=1)

The following procedures can be used to set variables of type List: ListFormat.List, Lists.Item and Document.Lists

For Each

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

Dim lst As List
For Each lst In ActiveDocument.Lists
	
Next lst

Methods

Other Methods

ApplyListTemplate - Applies a set of list-formatting characteristics to the specified ListFormat object.

ActiveDocument.Lists(1).ApplyListTemplate ListTemplate:=

ApplyListTemplateWithLevel - Applies a set of list-formatting characteristics, optionally for a specified level.

ActiveDocument.Lists(1).ApplyListTemplateWithLevel ListTemplate:=

CanContinuePreviousList - Returns a WdContinue constant (wdContinueDisabled, wdResetList, or wdContinueList) that indicates whether the formatting from the previous list can be continued.

Dim wceCanContinuePreviousList As WdContinue
wceCanContinuePreviousList = ActiveDocument.Lists(1).CanContinuePreviousList(ListTemplate:=)

ConvertNumbersToText - Changes the list numbers and LISTNUM fields in the specified List object.

ActiveDocument.Lists(1).ConvertNumbersToText

CountNumberedItems - Returns the number of bulleted or numbered items and LISTNUM fields in the specified List object.

Dim lngCountNumberedItems As Long
lngCountNumberedItems = ActiveDocument.Lists(1).CountNumberedItems()

RemoveNumbers - Removes numbers or bullets from the specified list.

ActiveDocument.Lists(1).RemoveNumbers

Properties

ListParagraphs returns a ListParagraphs collection that represents all the numbered paragraphs in the list, document, or range.

Dim lpsListParagraphs As ListParagraphs
Set lpsListParagraphs = ActiveDocument.Lists(1).ListParagraphs

Parent returns an object that represents the parent object of the specified List object.

Dim objParent As Object
Set objParent = ActiveDocument.Lists(1).Parent

Range returns a Range object that represents the portion of a document that is contained in the specified object.

Dim rngRange As Range
Set rngRange = ActiveDocument.Lists(1).Range

SingleListTemplate true if the entire list uses the same list template.

Dim booSingleListTemplate As Boolean
booSingleListTemplate = ActiveDocument.Lists(1).SingleListTemplate

StyleName returns the name of the style applied to the specified AutoText entry.

Dim strStyleName As String
strStyleName = ActiveDocument.Lists(1).StyleName

Lists.Count returns a Long that represents the number of lists in the collection.

Dim lngCount As Long
lngCount = ActiveDocument.Lists.Count

Lists.Parent returns an object that represents the parent object of the specified Lists object.

Dim objParent As Object
Set objParent = ActiveDocument.Lists.Parent