If I manually apply a Word table theme to a table, the table colors change when I change the word design theme using the list of color themes.
But, if I set the table colors programmatically to a specific RGB value, the table colors don't change when the theme changes. I suppose this is correct behavior, assuming that explicit color settings have priority over theme settings (that's the way font settings work).
My problem is that I can't find a way to set the row colors of a table to a theme accent color like I do for shapes. For shapes, I use
Code:
shape.Fill.foreColor.ObjectThemeColor = wdThemeColorAccent2
But for tables, there is no ObjectThemeColor variable. All I can find is this code, which chooses from a list of predefined wd* colors that have nothing to do with theme colors.
Code:
.Rows(i).Shading.ForegroundPatternColor = wdColorGold
Is it possible to set table row colors to theme accent colors?
I thought maybe you can only make those kinds of settings higher up in the table object, perhaps indirectly through a table style that is bound to the table. But looking at the object browser, there are no fields in the TableStyle or Style objects that look like the .Fill.<ColorFormatObject> that provides an ObjectThemeColor field.
It's possible for tables to respond to theme color changes because I see it happen with my eyes. But maybe it's not possible programmatically. If anyone can point me in the right direction, I would appreciate it. thank you