Get inspector reference at ProcessOpen event

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

Get inspector reference at ProcessOpen event
 
wehbi




Posts: 76
Joined: 2013-10-31
Hi Adx-Team,

when the ProcessOpen event is fired and I try to get a reference to the inspector, I am not able to get those exact in this moment. What I have tried is to do a Windows Forms timer delay, which is leading to a solution, but this is causing some problems with releasing the com object references under some circumstances in case multiple inspectors are opened.
Is there a proper way to get the item which is a result of the ProcessOpen event without using a timer?

Thanks for your help and kind regards,
Wehbi
Posted 20 Apr, 2020 02:07:02 Top
Andrei Smolin


Add-in Express team


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

You initialize an ADXOutlookItemEvents with an Outlook item. That item is available via ADXOutlookItemEvents.ItemObj. Cast that value to an appropriate Outlook item type and call Outlook._Inspector theInspector = {an Outlook item type such as _MailItem}.GetInspector. Note that you should release theInspector variable after use.


Andrei Smolin
Add-in Express Team Leader
Posted 20 Apr, 2020 02:19:45 Top
wehbi




Posts: 76
Joined: 2013-10-31
Thanks for your answer! The problem is that I'm trying to show up the side panel programmatically, but this is only working as soon as the mail inspector is displayed, otherwise the form is null.
Is there another way to work without a timer delay and show up the side panel immediately?
Posted 21 Apr, 2020 04:02:04 Top
Andrei Smolin


Add-in Express team


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

I'm not sure that I understand you goal.

You cam try to look at this from a different perspective. The need to show the pane immediately (why? what for?) may mean you need to react to the pane's ADXBeforeFormShow or ADXAfterFormShow event instead. In this scenario, the Forms Manager will create a from when it is suitable and you react to the form being shown. Isn't this what you need?


Andrei Smolin
Add-in Express Team Leader
Posted 21 Apr, 2020 04:48:56 Top
wehbi




Posts: 76
Joined: 2013-10-31
Hello Andrei,

let me try to describe my use case. For example, I marked a mail by using properties (Outlook.UserProperty) and put it into the drafts, when the mail is opened again from the drafts, I'm checking for the properties and if the search was positive I want to show the side panel with certain information.
So how can I achieve to read the properties and then immediately show the side panel. Till now I am only able to do an delay, till the mail inspector is shown - there may a much better way, but I'm not aware.
If you need further information, please let me know.

Regards,
Wehbi
Posted 21 Apr, 2020 05:59:46 Top
Andrei Smolin


Add-in Express team


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

Instead of showing the pane in an inspector window, set the ADXOlFormsCollectionItem so that the pane is shown whenever the inspector window is shown and react to the pane's ADXBeforeFormShow event: read the user properties, and set the pane's Visible=true to let the pane show or ADXOlForm.Visible=false to prevent the pane from showing.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Apr, 2020 06:14:30 Top