Word 2007 更改主题时发生的事件
我是否可以从 VSTO 应用程序注册一个事件,该事件会在 Word 2007 主题更改时触发?
Is there an event I can register from my VSTO application that is fired when the theme of Word 2007 is changed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正如 crauscher 所说,当用户更改 Office 2007 应用程序的主题时,Office 似乎不会触发任何公共事件。
您可以做的最简单的方法是定期轮询注册表项以查看是否有更改:
其中 Theme 为
1
for Blue,2
代表银色,3
代表黑色 方案。本文为您提供了一些可以使用和修改的 C# 代码:设置背景颜色以匹配 Office 2007 配色方案
As crauscher said, Office doesn't seem to trigger any public event when the theme for an Office 2007 application is changed by the user.
The easiest you could do is to poll the registry key at regular intervals to see if there was a change:
Where Theme is
1
for Blue,2
for Silver and3
for the Black scheme.This article gives you some C# code you can use and modify: Setting the BackColor to match the Office 2007 color scheme
本文 描述主题设置存储在注册表中,但不通过 VSTO API 公开。
This article describes that the theme settings are stored in the registry but not expose through VSTO API.
我从未见过这样的事件。
我只知道以下 Word 事件,请参阅
链接文本另请参阅适用于 Office 的 Visual Studio 工具
I have never seen an event that does that.
I am only aware of the following Word events, see
link text also see Visual studio tools for Office