A
andreas
Dear Experts:
below macro alters the Background color settings for odd rows on a
user-defined table style (Word 2003).
I got two (2) other user-defined table styles (User-Defined-Table-
Style-normal and User-Defined-Table-Style_academic) which also should
acquire this altered background color settings. The stlyes have been
created independently from each other, that is, no style is based upon
another.
So, my QUESTION is:
how do I have to alter the code so that all the user-defined table
styles get the different background pattern color in one go?
I could copy the macro code and paste it one after the other changing
just the Table Style Name. But I am sure there is a more elegant way
to do this, using "Do-Loop".
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
Sub ChangeTableStyle()
Dim styTable As Word.Style
Set styTable = ActiveDocument.Styles("User-Defined-Table-Style_1")
With styTable.Table
.RowStripe = 1
With .Condition(wdOddRowBanding)
.Shading.Texture = wdTextureNone
.Shading.BackgroundPatternColor = RGB(188, 188, 70)
End With
End With
End Sub
below macro alters the Background color settings for odd rows on a
user-defined table style (Word 2003).
I got two (2) other user-defined table styles (User-Defined-Table-
Style-normal and User-Defined-Table-Style_academic) which also should
acquire this altered background color settings. The stlyes have been
created independently from each other, that is, no style is based upon
another.
So, my QUESTION is:
how do I have to alter the code so that all the user-defined table
styles get the different background pattern color in one go?
I could copy the macro code and paste it one after the other changing
just the Table Style Name. But I am sure there is a more elegant way
to do this, using "Do-Loop".
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
Sub ChangeTableStyle()
Dim styTable As Word.Style
Set styTable = ActiveDocument.Styles("User-Defined-Table-Style_1")
With styTable.Table
.RowStripe = 1
With .Condition(wdOddRowBanding)
.Shading.Texture = wdTextureNone
.Shading.BackgroundPatternColor = RGB(188, 188, 70)
End With
End With
End Sub