View Single Post
 
Old 02-11-2012, 12:30 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Windows 7 64bit Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 4,005
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Look up the wdListNumberStyle constant in the Object Browser of the Visual Basic Editor. You'll notice that there are more numbering styles than offered in the user interface. For example:

Code:
 
Sub ApplyFormattingToNumList()
Dim lt As ListTemplate
Dim s As ListTemplate
For Each s In ActiveDocument.ListTemplates
If s.Name = "tryout" Then
Set lt = s
Exit For
End If
Next s
With lt
.ListLevels(1).NumberStyle = wdListNumberStyleLowercaseTurkish
'add code for other settings and for other levels here
End With
Selection.Range.ListFormat.ApplyListTemplate lt
End Sub
Code:
Sub CreateListTemplate()
Dim lt As ListTemplate
Set lt = ActiveDocument.ListTemplates.Add(OutlineNumbered:=True, Name:=tryout)
End Sub
Note that in this simplified example I have applied the list format directly to text, while it is wiser to attach each level to a paragraph style.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote