View Single Post
Old 05-17-2011, 04:59 PM   #1
heixi619
 
Posts: n/a
Default Windows 7 Key VBA values for Office theme colors

Recently,Microsoft Office Professional Plus 2010, there was a thread on UtterAccess that I thought might be helpful to more people. The poster radish asks: I'd like to change the color of a control then be able to change it back to its original color. If I wanted to use the theme's highlight color,Microsoft Office 2007 Enterprise, e.g.,Windows 7 Activation, how would I do that in code? It's listed in the property sheet as "Highlight". Sure, I could grab the values of that color but is it possible to reference "Highlight",Microsoft Office Professional 2010, "Access Theme 5" or "Dark Blue 3" in vba code? Access 2007 has a series of generic colors that change color based on the Office theme color. Internally,Windows 7 Key, we store negative numbers and map those to predefined colors in the theme color table. You can get the underlying value using the immediate window. Something like: ?forms("colors").Controls("Text16").backcolor In case you are lazy like me—here is a table of the color values you need to use in VBA to have it theme with the Office theme color. Color VBA Color Value Alternate Row -2147483610 Background Form -2147483613 Background Light Header -2147483612 Borders/Gridlines -2147483609 Text Black -2147483617 Text description -2147483614 Text Light -2147483616 Text Dark -2147483615 Highlight -2147483608 Here is a link where you can get similar color values for system colors.
  Reply With Quote

Sponsored Links