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 .

Ferreting out List Templates

At this point we believe we have a customized List Template in our Active Document, but no customized List Templates in our Attached Template.

We focus on our Active Document.

We think we have a single customized List template; furthermore we believe it is in the “Bulleted List” List gallery, that is, it is classified as a “Bulleted” rather than a “Numbered” or a “Outline Numbered”.

This little test:

Sub Test7()

Debug.Print ""

Debug.Print "ActiveDocument.ListTemplates.Count " & ActiveDocument.ListTemplates.Count

Dim lng As Long

For lng = 1 To ActiveDocument.ListTemplates.Count

With ActiveDocument.ListTemplates(lng)

Debug.Print lng & " .ListLevels.Count " & .ListLevels.Count

End With

Next lng

End Sub

offers surprising results:

ActiveDocument.ListTemplates.Count 1

1 .ListLevels.Count 9

So surprising in fact that we shut down and re-open Word, re-open our slightly-modified Document and re-run the test.

Yes! The one List template in our document is an Outline Numbered List template!

How odd.

If this is so, we ought to be able to assign a name to it.

Sub Test7()

Debug.Print ""

Debug.Print "ActiveDocument.ListTemplates.Count " & ActiveDocument.ListTemplates.Count

Dim lng As Long

For lng = 1 To ActiveDocument.ListTemplates.Count

With ActiveDocument.ListTemplates(lng)

Debug.Print lng & " .ListLevels.Count " & .ListLevels.Count

.Name = "A20080921"

End With

Next lng

End Sub

We use the dialog box to reset that rogue List Template shown in the lower-right-hand corner, and run a modified macro:

Sub Test7()

Debug.Print ""

Debug.Print "ActiveDocument.ListTemplates.Count " & ActiveDocument.ListTemplates.Count

Dim lng As Long

For lng = 1 To ActiveDocument.ListTemplates.Count

With ActiveDocument.ListTemplates(lng)

Debug.Print lng & " .ListLevels.Count " & .ListLevels.Count

Debug.Print lng & " .Name " & .Name

End With

Next lng

End Sub

This shows us:

ActiveDocument.ListTemplates.Count 1

1 .ListLevels.Count 9

1 .Name A20080921

that we still have a named List Template lurking in our document.

Let’s examine the entrails of our sole customized List Template:

Sub Test7()

Debug.Print ""

Debug.Print "ActiveDocument.ListTemplates.Count " & ActiveDocument.ListTemplates.Count

Dim lng As Long

For lng = 1 To ActiveDocument.ListTemplates.Count

With ActiveDocument.ListTemplates(lng)

Debug.Print lng & " .ListLevels.Count " & .ListLevels.Count

Debug.Print lng & " .Name " & .Name

If .ListLevels.Count = 9 Then

Call DisplayLevels(ActiveDocument.ListTemplates(lng))

Else

End If

End With

Next lng

End Sub

Public Function DisplayLevels(lstT As ListTemplate)

With lstT

Dim lng As Long

For lng = 1 To 9

With .ListLevels(lng)

Debug.Print ""

Debug.Print ".Alignment " & .Alignment

Debug.Print ".Font.Name " & .Font.Name

Debug.Print ".Index " & .Index

Debug.Print ".LinkedStyle " & .LinkedStyle

Debug.Print ".NumberFormat " & .NumberFormat

Debug.Print ".NumberPosition " & .NumberPosition

Debug.Print ".NumberStyle " & .NumberStyle

Debug.Print ".ResetOnHigher " & .ResetOnHigher

Debug.Print ".StartAt " & .StartAt

Debug.Print ".TabPosition " & .TabPosition

Debug.Print ".TextPosition " & .TextPosition

Debug.Print ".TrailingCharacter " & .TrailingCharacter

End With

Next lng

End With

End Function

In this lengthy (nine levels!) output, the first level is of interest to us:

ActiveDocument.ListTemplates.Count 1

1 .ListLevels.Count 9

1 .Name A20080921

.Alignment 0

.Font.Name Book Antiqua

.Index 1

.LinkedStyle

.NumberFormat ±

.NumberPosition 18

.NumberStyle 23

.ResetOnHigher 0

.StartAt 1

.TabPosition 36

.TextPosition 36

.TrailingCharacter 0

.Alignment 0

.Font.Name Courier New

.Index 2

.LinkedStyle

.NumberFormat o

.NumberPosition 54

.NumberStyle 23

.ResetOnHigher 1

.StartAt 1

.TabPosition 72

.TextPosition 72

.TrailingCharacter 0

.Alignment 0

.Font.Name Wingdings

.Index 3

.LinkedStyle

.NumberFormat ?

.NumberPosition 90

.NumberStyle 23

.ResetOnHigher 2

.StartAt 1

.TabPosition 108

.TextPosition 108

.TrailingCharacter 0

.Alignment 0

.Font.Name Symbol

.Index 4

.LinkedStyle

.NumberFormat ?

.NumberPosition 126

.NumberStyle 23

.ResetOnHigher 3

.StartAt 1

.TabPosition 144

.TextPosition 144

.TrailingCharacter 0

.Alignment 0

.Font.Name Courier New

.Index 5

.LinkedStyle

.NumberFormat o

.NumberPosition 162

.NumberStyle 23

.ResetOnHigher 4

.StartAt 1

.TabPosition 180

.TextPosition 180

.TrailingCharacter 0

.Alignment 0

.Font.Name Wingdings

.Index 6

.LinkedStyle

.NumberFormat ?

.NumberPosition 198

.NumberStyle 23

.ResetOnHigher 5

.StartAt 1

.TabPosition 216

.TextPosition 216

.TrailingCharacter 0

.Alignment 0

.Font.Name Symbol

.Index 7

.LinkedStyle

.NumberFormat ?

.NumberPosition 234

.NumberStyle 23

.ResetOnHigher 6

.StartAt 1

.TabPosition 252

.TextPosition 252

.TrailingCharacter 0

.Alignment 0

.Font.Name Courier New

.Index 8

.LinkedStyle

.NumberFormat o

.NumberPosition 270

.NumberStyle 23

.ResetOnHigher 7

.StartAt 1

.TabPosition 288

.TextPosition 288

.TrailingCharacter 0

.Alignment 0

.Font.Name Wingdings

.Index 9

.LinkedStyle

.NumberFormat ?

.NumberPosition 306

.NumberStyle 23

.ResetOnHigher 8

.StartAt 1

.TabPosition 324

.TextPosition 324

.TrailingCharacter 0

Review Of List Templates

Contact Me