Christopher Greaves |
|||
Christopher Greaves |
|||
If you are interested in applications please visit www.VBASolutions.ca .
If you are interested in end-user macros please visit www.TorontoMacros.com .
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
1 .ListLevels.Count 9
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
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
1 .ListLevels.Count 9
1 .Name A20080921
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
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