Send To - Mail recipient not raising NewInspector evemt

Add-in Express™ Support Service
That's what is more important than anything else

Send To - Mail recipient not raising NewInspector evemt
 
Tibor V?zh?ny?




Posts: 14
Joined: 2017-03-13
In our add-in we are changing the ribbon buttons visibility depending on external conditions (nothing fancy, like if an application is available or not, or a backend server is available or not). Checking these conditions is asynchronous so we implemented an MVP pattern, where the presenter will change the visibility of the ribbon buttons when they finished figured out the conditions states.

We are creating these presenter objects on the NewExplorer and NewInspector events, everything looks fine until the user tries to send an email by right-clicking a file then click Send To -> Mail recipient.

In this use case there is no NewInspector event raised.
The add-in (AddinModule) is started and the Initialize event raised.

What is the most reliable way to recognize/handle this use case, which event should I subscribe to?

Thank you
Posted 11 Jan, 2023 10:53:37 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
Hello Tibor,

Tibor V?zh?ny? writes:
What is the most reliable way to recognize/handle this use case


There's no solution to this issue. What you see is called a Simple MAPI inspector. It is opened modally and no Outlook events accompany this. I remember that if you open such an inspector when Outlook isn't running, the add-in is loaded only when you close the inspector - for a brief moment between closing the inspector and exiting Outlook.

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 12 Jan, 2023 06:21:49 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
Posted 12 Jan, 2023 09:23:52 Top
Tibor V?zh?ny?




Posts: 14
Joined: 2017-03-13
To handle this you need to run a timer in the same thread as the Outlook application. When the timer fires you can check the Inspectors collection for Inspectors that you aren't handling. If you find a Simple MAPI Inspector you can add handling for it and add event handlers such as the Send() event handler.


Omigosh....

Thank you, Andrei, for this explanation.
(I mean this completely cleared for me what should I do.)
Posted 13 Jan, 2023 03:48:53 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
You are welcome!

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Jan, 2023 06:50:35 Top