View Single Post
 
Old 02-17-2023, 12:06 PM
TheBigBoss TheBigBoss is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Dec 2016
Posts: 56
TheBigBoss is on a distinguished road
Default

Found the solution, almost...
Code:
Sub SelectNumberingAndChangeFont()
    Dim para As Paragraph
    Dim list As list
    Dim lvl As ListLevel
    Dim lev As ListTemplate
    
    For Each lev In ActiveDocument.ListTemplates
        For Each lvl In lev.ListLevels
                lvl.Font.Name = "Times New Roman"
            Next lvl
    Next lev
End Sub
Now the tricky part, it shouldn't changed to Times New Roman for the third-level (third-level should remain SimSun). Using ListIndex returns the index not the level; how to know the level of the list from ListLevels?


Code:
Sub SelectNumberingAndChangeFont()
    Dim para As Paragraph
    Dim list As list
    Dim lvl As ListLevel
    Dim lev As ListTemplate
    
    For Each lev In ActiveDocument.ListTemplates
        For Each lvl In lev.ListLevels
           If lvl.Index <> 3 Then
           'If lvl.LevelNumber <> 3 Then
                lvl.Font.Name = "Times New Roman"
            End If
            Next lvl
    Next lev
End Sub
Reply With Quote