Catch switching window/document event

Started by timdeweert, June 23, 2017, 09:40:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

timdeweert

I developed an add in for Visio and I'm having some trouble with catching certain events. I have a custom ribbon for my add in and what I already can do, is enabled or disabled (show/hide) it based on the document.

But now I would like to have multiple documents open and check when switching to another document if the ribbon should be enabled or disabled. However I can not seem to find the right event code for this. I tried the following codes but with no luck:
- PageChanged
- WindowChanged
- BeforeWindowPageTurn
- WindowTurnedToPage

So concretely what I would like to do is catch the event when one document loses focus and another one gets the focus.

Miki

Did you tried "DocumentChanged" event?
"WindowsTurnedToPage" is triggered when you go from, say, Page-1 to Page-2 in the same document.

If "DocumentChanged" does not work, try "AppActivated" and "AppDeactivated" events. These show up in the event monitor when you try to switch documents.

Let me know if any of them works.

- Miki