Amit chauhan
Amit chauhan

Reputation: 540

Event to know which outlook window got focus when user switches between multiple windows of outlook in vsto plugin

I am working on an outlook vsto plugin, suppose there are multiple inspectors of outlook opened(e.g. mails,appointments). I want an EVENT to know when user switches to different inspector using ALT+Tab, or Which inspector got focus. what i want to achieve is am Enabling/Disabling a ribbon button by checking the kind of Item opened in inspector like if Appointment item (button enabled) else (disabled). I have achieved half of the task by setting button enabled in Appointment_open() event. the problem start arising when user moved to another inspector of outlook using ALT+Tab then the ribbon button is left enabled. if i get the event of which inspector got focus i can set the enabled property to true or false.

Upvotes: 1

Views: 311

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66255

Use Application.ActiveExplorer / ActiveInspector properties.

Both Inspector and Explorer objects expose the Activate event.

Upvotes: 1

Related Questions