View Single Post
 
Old 12-26-2017, 09:35 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You could use something like the following which will set no border and fill the cells with a light grey shading for all tables. Change or add whatever else you need in the FormatTable macro.

Code:
Sub UpdateAllTables()
Dim oStory As Range
Dim oTable As Table
    For Each oStory In ActiveDocument.StoryRanges
        For Each oTable In oStory.Tables
            FormatTable oTable
        Next oTable
        If oStory.StoryType <> wdMainTextStory Then
            While Not (oStory.NextStoryRange Is Nothing)
                Set oStory = oStory.NextStoryRange
                For Each oTable In oStory.Tables
                    FormatTable oTable
                Next oTable
            Wend
        End If
    Next oStory
    Set oStory = Nothing
lbl_Exit:
    Exit Sub
End Sub

Private Sub FormatTable(oTable As Table)
    With oTable
        .Borders.OutsideLineStyle = wdLineStyleNone
        .Shading.BackgroundPatternColor = wdColorGray10
    End With
lbl_Exit:
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote