List Object

Description

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.

Using the List Object

Use Lists(index), where index is the index number, to return a single List object. The following example returns the number of items in list one in the active document.

mycount = 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.

Remarks

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.

Properties

Application property, Creator property, ListParagraphs property, Parent property, Range property, SingleListTemplate property.

Methods

ApplyListTemplate method, CanContinuePreviousList method, ConvertNumbersToText method, CountNumberedItems method, RemoveNumbers method.

See Also

ListFormat property.