ADXNewInspector triggers twice for ADXOIForm.

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

ADXNewInspector triggers twice for ADXOIForm.
ADXNewInspector triggers twice for ADXOIForm when I select file from system -> right clicks -> selects Send to -> Mail recipient 
Omkar Deshpande


Guest


Hi

I have observed strange behavior for the ADXNewInspector event of the ADXOlForm class.
It works perfectly when I click on the new email button on Outlook. After this button click, new email compose window is opened and ADXNewInspector event is called only once where I am initializing few values.
But when I select file from file system -> right click -> select Send to -> Mail recipient. It opens the the new compose window with file attached but the ADXNewInspector event is called twice.
In both cases, Dispose method is called only once.
Is it expected behavior and I am missing anything. Can you please let me know how should I make sure this event get called only once for second scenario.

Thanks,
Omkar
Posted 03 Jan, 2020 06:32:54 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Omkar,

I can't reproduce this. I wonder if this occur if you turn off *all* other COM add-ins.


Andrei Smolin
Add-in Express Team Leader
Posted 03 Jan, 2020 07:50:50 Top
Omkar Deshpande


Guest


Hi Andrei,

I have multiple add-ins running on my laptop as well as on VM. This issue is reproducible on VM be it all add-ins running or only my new add-in running. I cannot disable all add-in on my laptop to verify the behavior due to company policies.
My function starts with the logging :
private void ADXOlTooltipTicker_ADXNewInspector(object sender, ADXNewInspectorEventArgs args)
{
VSLogger.log.Info("New outlook compose window opened.");

In case of normal New Email button click to open compose window and closing it, logs are like:
01-05-2020 21:34:24.157 [INFO ] XXX.YYY.ADXOlTooltipTicker_ADXNewInspector : New outlook compose window opened.
01-05-2020 21:34:24.782 [DEBUG] XXX.YYY.ADXOlTooltipTicker_ADXNewInspector : Ticker is initialized.
01-05-2020 21:34:38.032 [INFO ] XXX.YYY.Dispose : Outlook window is closed by one of the action: send, close.

In case of select file from system -> right clicks -> selects Send to -> Mail recipient and then closing the window, logs are like:
01-05-2020 21:36:31.579 [INFO ] XXX.YYY.ADXOlTooltipTicker_ADXNewInspector : New outlook compose window opened.
01-05-2020 21:36:31.735 [DEBUG] XXX.YYY.ADXOlTooltipTicker_ADXNewInspector : Ticker is initialized.
01-05-2020 21:36:31.767 [INFO ] XXX.YYY.ADXOlTooltipTicker_ADXNewInspector : New outlook compose window opened.
01-05-2020 21:36:32.141 [DEBUG] XXX.YYY.ADXOlTooltipTicker_ADXNewInspector : Ticker is initialized.
01-05-2020 21:36:47.344 [INFO ] XXX.YYY.Dispose : Outlook window is closed by one of the action: send, close.

In second case, the NewInspector event triggers twice, generating all subsequent calls/initializations twice.
Please let me know if you need more information to reproduce at your side. Above scenarios are verified on Outlook
of Office 365 and Outlook 2013.

Thanks,
Omkar
Posted 06 Jan, 2020 01:15:22 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Omkar,

Please install the add-in we describe at https://www.add-in-express.com/creating-addins-blog/2010/07/01/outlook-events-tool/. Does it reproduce the issue?


Andrei Smolin
Add-in Express Team Leader
Posted 08 Jan, 2020 05:55:24 Top
Omkar Deshpande


Guest


Hi Andrei,

With this add-in I can see New inspector event only once for normal "New Email" button click.
But with "Select Send To" option, Outlook Explorer gets deactivated and your add-in do not show any events for new inspector window. When I close the compose window, Outlook explorer gets activated.
Please see output when I select "Select Send To" option for file:
= 5:24:11 PM = ADXOutlookAppEvents.ExplorerDeactivate. Current Folder name is 'Inbox', Explorer caption is 'Inbox - omkar_adeshpande@persistent.com - Outlook'
= 5:24:27 PM = ADXOutlookAppEvents.ItemLoad.
= 5:24:41 PM = ADXOutlookAppEvents.ExplorerAddCommandBars. Current Folder name is 'Inbox', Explorer caption is 'Inbox - omkar_adeshpande@persistent.com - Outlook'
= 5:24:41 PM = ADXOutlookAppEvents.ExplorerActivate. Current Folder name is 'Inbox', Explorer caption is 'Inbox - omkar_adeshpande@persistent.com - Outlook'
= 5:24:42 PM = ADXOutlookAppEvents.ExplorerAddCommandBars. Current Folder name is 'Inbox', Explorer caption is 'Inbox - omkar_adeshpande@persistent.com - Outlook'
= 5:24:42 PM = ADXOutlookAppEvents.ExplorerActivate. Current Folder name is 'Inbox', Explorer caption is 'Inbox - omkar_adeshpande@persistent.com - Outlook'

Let me know if I need to change any setting to get events for "Send To" option.

Thanks,
Omkar
Posted 08 Jan, 2020 06:55:10 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Omkar,

I see. At last I see it. Sorry for this delay. We confirm that this issue may occur in some scenarios. We will consider setting a flag in our code to prevent that event from firing twice. Meanwhile, you can use a flag to specify that you have already initialized some object.


Andrei Smolin
Add-in Express Team Leader
Posted 08 Jan, 2020 07:32:02 Top
Omkar Deshpande


Guest


Thanks Andrei for confirmation.
I have added flag to prevent double initialization.
How will I get notified when add-in express is updated with this fix?

-Omkar
Posted 09 Jan, 2020 05:23:46 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Omkar,

This issue is now filed under #17083 in our issue-tracking DB. Once the fix is available in a new Add-in Express build, you'll find that number in {Add-in Express installation folder}\whatsnew.txt and at https://www.add-in-express.com/add-in-net/history.php.


Andrei Smolin
Add-in Express Team Leader
Posted 09 Jan, 2020 06:10:54 Top
Omkar Deshpande


Guest


Hi Andrei,

I am facing one more issue with the "select file from file system -> right click -> select Send to -> Mail recipient".

I am using adxOutlookAppEvents.NewInspector event for some processing. This event gets called when I use New Email button but it does not get called/triggered at all when I use "Context menu option ->select file from file system -> right click -> select Send to -> Mail recipient" to open new Inspector window.

My Log Statement is:
private void adxOutlookAppEvents_NewInspector(object sender, object inspector, string folderName)
{
VSLogger.log.Info("adxOutlookAppEvents_NewInspector Called.");
}

Can you please verify and let me know if I am missing anything?

Thanks,
Omkar
Posted 21 Jan, 2020 01:16:56 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Omkar,

Omkar Deshpande writes:
but it does not get called/triggered at all when I use "Context menu option ->select file from file system -> right click -> select Send to -> Mail recipient"


This is expected: Outlook doesn't invoke that event in this scenario.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Jan, 2020 02:18:34 Top