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)


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext