gpt4 book ai didi

VSTO - MS Office 'Color Scheme' 更改事件

转载 作者:行者123 更新时间:2023-12-04 18:28:57 26 4
gpt4 key购买 nike

使用 VSTO,如何获得 MS Office 配色方案更改的通知?

最佳答案

希望 Office 2010 存在更好的东西。这是我用于 Office 2007 和 Word 的内容(这不是任何形式的通知,只是需要检查的内容):

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;
}
}

关于VSTO - MS Office 'Color Scheme' 更改事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3631461/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com