View Single Post
 
Old 12-20-2016, 11:12 PM
rocky2 rocky2 is offline Windows 10 Office 2013
Novice
 
Join Date: Feb 2016
Posts: 25
rocky2 is on a distinguished road
Default

This is the code I used (I marked the line in which I get an exception):

Code:
Sub FixWhiteFontInTable()

With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Style = ActiveDocument.Styles("Table Heading")
    .Text = ""
    .Forward = True
    .Execute Format:=True, Forward:=True
  End With
  Do While .Find.Found
    If .Information(wdWithInTable) Then
      If .Cells(1).RowIndex > 2 Then
        
        Selection.Font.ColorIndex = wdBlack
        
      End If
   
    End If
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With

End Sub
What did I miss?
Reply With Quote