[Originally appeared 1999.]
After a few weeks pause, let’s return to automatic numbering. The e-mail on this issue continues to include strong expression. There was even a discussion thread on a WordPerfect newsgroup (although not sent to me), citing this column as an explanation why not to change from WordPerfect to Word. This column is not about competition between word processors. The column is devoted to excellent use of Microsoft Word to create, edit, and complete the documents of large organizations, with a focus on those of legal practice. In doing so, it is helpful and essential to understand the relationship of WordPerfect and Word, as last week’s column on Reveal Codes emphasized. If this discussion succeeds, then users of both word processors can learn to do their work better.
The previous columns on numbering became fairly complex, so it would be nice to tackle one “simple” issue, such as restarting a numbering sequence in the middle of a document. Would that “simple” be the proper adjective. Your comments and many others have described a variety of problems that can occur when restarting, including the changes in tabs and indents described in issue Word of Law No. 3. The numbering restarts may disappear when a new numbering scheme is applied. What is happening? Can all these problems be avoided?
Be warned. There is no way to fully explain the issues raised by a numbering restart without getting quite technical about Word’s structure, commands and operation. My aim is to challenge WOW’s readers to understand Word more thoroughly, and the crew at Microsoft to address carefully what they have constructed as they design improvements for Word 10.
Assume that a document has been formatted with a sequence of Heading 1 through Heading 9 styles, with each linked to an appropriate numbering format. Most documents do not require all 9 levels. Somewhere in the middle of the document (such as after the main body of the text ends and the exhibits or appendixes begin), the Heading 1 paragraph numbers need to restart with “1.”
One would imagine some sort of “simple” code that would cause the renumbering to occur. The paragraph where it occurs would need a property that starts the numbering again. Each continuous sequence of numbered paragraphs is a List, so the paragraph with the numbering restart needs to start a new list. So, we need a command that makes the numbering property of a paragraph (its ListFormat) start over. One could imagine a command like :
Selection.Range.ListFormat ContinuePreviousList:=False
Sorry, misplaced imagination. An example of working macro code that permits Word 97 to do restart paragraph numbering, generated (along with much else) from the “Restart” button on the Bullets and Numbering dialog, reads:
Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=ListGalleries( _ wdOutlineNumberGallery).ListTemplates(6), ContinuePreviousList:=False, _ApplyTo:=wdListApplyToWholeList
So, Word must “apply” something called a “ListTemplate” to the paragraph and to the List in order to restart numbering. And, what is that code retrieving the ListTemplate from the ListGalleries(wdOutlineNumberGallery)?
This command opens the window to the core of Word 97’s paragraph numbering. It will take a good deal more than this week’s column to explore it fully.
A ListTemplate is not a template as we know it for other purposes in Word. It is not a separate file, but an object in Word’s object model. It can attach to a document or a template. As one would expect, a document inherits the ListTemplates contained in the template on which it is based. A ListTemplate is a container that groups the numbering and related format controls for a List. Each ListTemplate consists of either 1 or 9 ListLevels, depending on whether the OutlineNumberedproperty of the ListTemplate is true. Each ListLevel has a series of properties that set its numbering format, including the three that conflict with (and override) the similar settings in style formatting: NumberPosition (equivalent to FirstLineIndent), TextPosition (equivalent to LeftIndent) and TabPosition (the source of the Jason Tab).
A document or template can accumulate many ListTemplates, although there is no direct way to view them. The tool we have built into Word for controlling the ListTemplate settings is the Bullets and Numbering dialog. For OutlineNumbered ListTemplates, the Customize dialog of the OutLine Numbered tab of that dialog includes controls for almost all of the ListTemplate ListLevel properties. “Almost,” because the dialog omits a control for the TabPosition property, leaving us to the programmed 0.25 inch setting.
Now look harder at where the macro code example found the ListTemplate it used for the paragraph numbering restart: ListGalleries(wdOutlineNumberGallery).ListTemplates(6). Instead of taking the ListTemplate from the document or its attached template, Word took it from one of the ListTemplates in yet another collection of objections called the ListGallery. There are three ListGalleries, corresponding to the three tabs on the Bullets and Numbering dialog. They each have a default set of ListTemplates associated with their positions. When customized, the settings of the List Gallery, including the associated ListTemplate, are stored in the individual user’s Windows registry.
I hope you find that last sentence worthy of a least a week’s thought. It has important implications for numbering standards in an organization and the behavior (or misbehavior) of documents with automatic numbering. Fear not, the exploration will continue.
This 1999 article originally appeared in Office Watch. Subscribe to Office Watch free at http://www.office-watch.com/.