0
votes

I'm trying to set font styling only to tables after the second Word page. so far I got:

Sub defaultFontStyling()

    If Selection.Information(wdWithInTable) = True Then
        
        Range.Font.Name = "Calibri"
        Range.Font.Size = 11
        
    End If

End Sub

I don't have any tables on the first page but still, it changes the font styling also there (In the entire document).

Does someone know how to fix it?

1
What range is Range? - Paul Ogilvie
Probably you can just use Selection.Font.Name and .Size - Paul Ogilvie

1 Answers

2
votes

Try this:

Sub defaultFontStyling()
    Dim table As table
    For Each table In ActiveDocument.Tables
        If table.Range.Information(wdActiveEndAdjustedPageNumber) > 1 Then
            With table.Range.Font
                .Name = "Calibri"
                .Size = 11
            End With
        End If
    Next
End Sub