Search code examples
c#.netoutlookvstooutlook-2010

How to set the forecolor of a label control to match the selected outlook theme?


How do I set the color of my labels in a custom form region I developed for Outlook 2010 to match the user selected theme color? Please see picture below about the demonstration of what I'm trying to do.

I'm trying to match my custom form label forecolor to whatever the selected theme forecolor is of the Outlook instance.

Attempting to match the color of a control to the Outlook 2010 user selected theme


Solution

  • From what I can tell (and I may be wrong) Outlook gets its theme from Windows (unless you are meaning email or stationary theme. I would try that route.

    Update: Looking around some more I see if you go into an email and then Office Button -> Editor Options -> Theme you can choose between 3 default themes (blue, black and silver) but the only thing I can see that updates in the registry is the key at:

    HKCU\Software\Microsoft\Office\12.0\Common\Theme
    

    I'm using Office 2007. The bad part is that it is just plugging in a hex number that appears to correspond to the theme but I don't see where one can find the mappings for this.