Chapter 17. The List Object

In this chapter:

  • List Types

  • The List Object

  • The ListTemplate Object and ListGalleries

  • Example: Looking at Lists

Lists play an important role in Word documents, and the Word object model contains objects that give the programmer very powerful control over lists. Figure 17-1 shows most of these objects, which are children of the Document object. The List-Gallery object and ListGalleries collection, which are children of the Application object, are not shown.

List-related objects

Figure 17-1. List-related objects

The Word object model is a bit confusing when it comes to lists, partly because the Help documentation is decidedly nonpedagogic. To help clarify the situation, I will begin with a few remarks about lists.

List Types

There are three types of lists in Microsoft Word: single-level bulleted, single-level numbered, and multilevel outline-numbered. The term outline-numbered is a bit misleading, since an outline-numbered list can use either bullets or numbers (and need not include any numbers). Nonetheless, this is Microsoft’s term, so I will use it as well.

In the case of numbered lists (single-and multilevel), there are options to either restart the numbering or continue the numbering started in a previous list. If there is text between the list you are creating and a previous list, then Word will default to new numbering. If not, Word will continue the numbering from the ...

Get Writing Word Macros, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.