S
szcz.andrew
Hello everyone,
I'm trying to change the page color using VBA in Word 2007 and I am
having problems/finding inconsistancies - perhaps someone can help.
I understand that the 'page color' is *supposed* to be visible only
in WebView, but Word does allow you to change the color of the page as
seen in Page Layout, and I would like to do the same thing using VBA.
If you use the ribbon to change the page color, it works fine. If
you record this action, it generates the following code:
ActiveDocument.Background.Fill.ForeColor.ObjectThemeColor = _
wdThemeColorAccent1
ActiveDocument.Background.Fill.ForeColor.TintAndShade = [your
color]
ActiveDocument.Background.Fill.Visible = msoTrue
ActiveDocument.Background.Fill.Solid
This generated macro does not work on a new document (it is
incomplete). In fact, this code will only work if the page color has
been changed using the ribbon at least once. On a brand new document,
it does not change the page color as seen in page layout view.
This means the ribbon page color action performs some additional
work to ensure that page background colors are visible in page layout
view. Anyone have a clue as to what this code may be?
Sincerely,
Andrew
I'm trying to change the page color using VBA in Word 2007 and I am
having problems/finding inconsistancies - perhaps someone can help.
I understand that the 'page color' is *supposed* to be visible only
in WebView, but Word does allow you to change the color of the page as
seen in Page Layout, and I would like to do the same thing using VBA.
If you use the ribbon to change the page color, it works fine. If
you record this action, it generates the following code:
ActiveDocument.Background.Fill.ForeColor.ObjectThemeColor = _
wdThemeColorAccent1
ActiveDocument.Background.Fill.ForeColor.TintAndShade = [your
color]
ActiveDocument.Background.Fill.Visible = msoTrue
ActiveDocument.Background.Fill.Solid
This generated macro does not work on a new document (it is
incomplete). In fact, this code will only work if the page color has
been changed using the ribbon at least once. On a brand new document,
it does not change the page color as seen in page layout view.
This means the ribbon page color action performs some additional
work to ensure that page background colors are visible in page layout
view. Anyone have a clue as to what this code may be?
Sincerely,
Andrew