Christopher Greaves

Contact Me

ON LINE STORE

ON LINE STORE

ON LINE STORE

ON LINE STORE

List Numbering in Microsoft Word

The Nature Of The Problem ; Reading List ; List Numbering Is Broken ; Terminology ; Styles ; What Have We Got Here? ; Isolating A List Template ; Manipulating List Templates ; Review Of Outline Numbered List Templates ; Locating List Templates ; Removing Named List Templates ; What About The Other Two List Galleries? ; Creating Extra List Templates ; List Templates In The Document ; Making A Fresh Start ; Purge List Gallery History ; Ferreting out List Templates ; Review Of List Templates ; An Experiment With Simple Numbered List Templates ; A Built-In Numbered Simple List ; Using Named List Templates ; Steps To Build A Named List Template ; Structures ; Assembling The Style ; Assembling A List Template ; Checking It Out ; Locating A Named List Template ; Deleting List Templates ; Paste To New Document

If you are interested in applications please visit www.VBASolutions.ca .

If you are interested in end-user macros please visit www.TorontoMacros.com .

List Templates In The Document

Lets run a small macro to examine List Templates in the document, rather than List Templates in the List Gallery.

Remember that through the List gallery we will only ever see 3x7=21 List Templates.

Public Function ReportListTemplatesInDocument(doc As Document)

Debug.Print ""

Dim lstT As ListTemplate

For Each lstT In doc.ListTemplates

Debug.Print lstT.OutlineNumbered & vbTab & lstT.ListLevels.Count & vbTab & lstT.Name

Next lstT

Debug.Print ""

End Function

Sub TESTReportListTemplatesInDocument()

Call ReportListTemplatesInDocument(ThisDocument)

End Sub

Running the macro on my system results in:

True 9

True 9

Odd!

Now, are these two List Templates my un-named Outline Numbered Gallery members, or do they correspond to the changes I made, one each, in the Bulleted List and Numbered List galleries?

Let’s find out by changing another item in the Bulleted List gallery and then re-running our little macro.

(Changes one item in the Bulleted List Gallery, runs macro, finds an extra List Template!).

(Changes one item in the Numbered List Gallery, runs macro, finds an extra List Template!).

This confirms what John McGhie tells us “Every time you select some text and apply numbering to it using the dialog (or the numbering button), a brand new List Template is created,”.

Is it possible for us to clean out these extra List Templates?

Public Function ConvertListTemplatesInDocument(doc As Document)

Dim lstT As ListTemplate

For Each lstT In ActiveDocument.ListTemplates

lstT.Convert

Next lstT

End Function

Sub TESTConvertListTemplatesInDocument()

Call ReportListTemplatesInDocument(ThisDocument)

Call ConvertListTemplatesInDocument(ThisDocument)

Call ReportListTemplatesInDocument(ThisDocument)

End Sub

We find that there is no Delete or Reset method for our lstT, but the Convert method can be used.

This does not reduce the number of List templates in the document.

The Word 2000 VBA help File offers us a little gem:

Sub ResetListTemplatesInAllGalleries()

' This example resets all the list templates in the Bullets and Numbering dialog box back to the built-in formats.

Dim lstG As ListGallery

For Each lstG In ListGalleries

Dim lng As Long

For lng = 1 To 7

lstG.Reset Index:=lng

Next lng

Next lstG

End Sub

Running this macro does not reduce the number of List templates in the document, but it does reset the 3x7=21 items in the Bullets and Numbering dialog. However a strange thing happens.

I had experimented by changing the first Bulleted List template (Bulleted List, first row, 2nd item from left) to be a bright orange “at” symbol. Applied that to a paragraph, checked the Bullets and Numbering dialog, and there it was, first row second item.

After I had run my ResetListTemplatesInAllGalleries macro, the List template displayed as item 7, that is, second row, rightmost item:

Strange!

Just to prove it’s not a fluke, I repeated the exercise, changing Item 1 (1st row, 2nd from left) to show an olive “Plus” sign:

reran my macro:

The orange “@” List Template has disappeared from view in the List Gallery, the Olive plus has been shunted to become item number seven!

Making A Fresh Start

Contact Me