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

Hi Guessed, I posted a similar code above, it doesn't as Index doesn't return the level but just the index.

I found the solution to detect third-level using ListTemplates.ListLevels.
I use TextPosition. Since the list styles are well defined, the TextPosition is fixed and well known.

Code:
Sub SelectNumberingAndChangeFont()
    Dim para As Paragraph
    Dim list As list
    Dim lvl As ListLevel
    Dim lev As ListTemplate
    Dim i As Integer
    Dim ib As Integer
    i = 0
    ib = 0
    For Each lev In ActiveDocument.ListTemplates
        For Each lvl In lev.ListLevels
            Debug.Print "TXT POS - " & lvl.TextPosition
            If lvl.TextPosition <> 147.4 Then
                 lvl.Font.Name = "Times New Roman"
                ' Change numbering of list to Times New Roman at the exception of third-level numbering
            End If
            Next lvl
    Next lev
End Sub
Closing thread
Reply With Quote