dave
dave

Reputation: 386

Receiving events when user click Insert Chart in Word

I'm trying to intercept events when the user inserts a chart in Word 2007/2010. I know that using VBA you can bind events to certain buttons on the ribbon interface. However, chart insertion does not fire any events. I'm wondering if VSTO exposes more objects and events compared to VBA for office automation. Any comments or pointers are appreciated.

Upvotes: 0

Views: 218

Answers (2)

DarinH
DarinH

Reputation: 4879

No. VSTO doesn't expose any more events definitely and in some ways limits events over what you could receive using IExtensibility.

That said, as far as I know, there's no "explicit" event for "new chart".

But you still have a few options.

One would be to watch Doc.Changed and detect the addition of a chart. Not necessarily easy, but doable.

another might be to navigate through the old Toolbars and toolbars commands collections, find the "ADD CHART" menu or toolbar item and sink it's click event. I've used that technique to override things like FILE/SAVE, etc before. It's not foolproof but it can work for some things...

Upvotes: 1

Jake Ginnivan
Jake Ginnivan

Reputation: 2142

Unfortunately VSTO is only a managed wrapper around the Office Interop libraries, so it has no more hooks than using the Interop libraries. It just makes add-in development much easier with helpers and giving us designer support

Upvotes: 0

Related Questions