tags:

views:

87

answers:

3

Is there an event I can register from my VSTO application that is fired when the theme of Word 2007 is changed?

+1  A: 

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

crauscher
A: 

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

Koekiebox
+2  A: 

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:

HKEY_CURRENT_USER\Software\Microsoft\Office\12.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

Note though that Office 2010 is probably going to break, or at least extend, this mechanism in some way as it will allow anyone to create new Themes for Office.

Renaud Bompuis