Word 2007 更改主题时发生的事件

发布于 2024-08-04 01:01:03 字数 54 浏览 0 评论 0原文

我是否可以从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

谎言 2024-08-11 01:01:03

正如 crauscher 所说,当用户更改 Office 2007 应用程序的主题时,Office 似乎不会触发任何公共事件。

您可以做的最简单的方法是定期轮询注册表项以查看是否有更改:

Office 2007: HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\Theme
Office 2010: HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\Theme

其中 Theme 为 1 for Blue2 代表银色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:

Office 2007: HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\Theme
Office 2010: HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\Theme

Where Theme is 1 for Blue, 2 for Silver and 3 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

别念他 2024-08-11 01:01:03

本文 描述主题设置存储在注册表中,但不通过 VSTO API 公开。

This article describes that the theme settings are stored in the registry but not expose through VSTO API.

情徒 2024-08-11 01:01:03

我从未见过这样的事件。

我只知道以下 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文