Using VSTO, how can I get notification of changes to the MS Office color scheme?
A:
Hopefully something better exists with Office 2010. Here's what I used for Office 2007 and Word (This is not a notification in any way, just something to check for):
const string OfficeCommonKey =
@"Software\Microsoft\Office\12.0\Common";
const string OfficeThemeValueName = "Theme";
const int ThemeBlue = 1;
const int ThemeSilver = 2;
const int ThemeBlack = 3;
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(OfficeCommonKey, false))
{
int theme = (int)key.GetValue(OfficeThemeValueName,1);
switch (theme)
{
case ThemeBlue:
//...
break;
case ThemeSilver:
//...
break;
case ThemeBlack:
//...
break;
default:
//...
break;
}
}
Mike Regan
2010-09-03 21:17:06