G
Greg Maxey
If I create an table and add some cell specific shading then I can run this
code to change the shading:
Sub Test()
Dim oCell As Word.Cell
Dim oTbl As Word.Table
For Each oTbl In ActiveDocument.Tables
For Each oCell In oTbl.Range.Cells
If oCell.Shading.BackgroundPatternColor = RGB(229, 170, 91) Then
oCell.Shading.BackgroundPatternColor = RGB(93, 143, 86)
End If
Next
Next
End Sub
This works for a uniform table and it works on tables where cells are merge
horizontally. However, if I merge cells vertically then this code misses
the vertical merged cells.
If a vertically merged cell isn't a cell or part of a table cell collection
then what is it?
Thanks.
code to change the shading:
Sub Test()
Dim oCell As Word.Cell
Dim oTbl As Word.Table
For Each oTbl In ActiveDocument.Tables
For Each oCell In oTbl.Range.Cells
If oCell.Shading.BackgroundPatternColor = RGB(229, 170, 91) Then
oCell.Shading.BackgroundPatternColor = RGB(93, 143, 86)
End If
Next
Next
End Sub
This works for a uniform table and it works on tables where cells are merge
horizontally. However, if I merge cells vertically then this code misses
the vertical merged cells.
If a vertically merged cell isn't a cell or part of a table cell collection
then what is it?
Thanks.