Uniquely identifying Inspector windows

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

Uniquely identifying Inspector windows
 
Esteban Astudillo




Posts: 146
Joined: 2006-02-27
Is there a way to uniquely identify each Inspector window?

Im starting to investigate this myself but I was wondering if somebody here would have the information at hand. What Im looking after is a way to identify the Inspector, not the item contained in it (like MailItem.EntryID or similar)

Thanks in advance and I will post back here if I find the answer.
Posted 23 Mar, 2006 11:33:18 Top
Sergey Grischenko


Add-in Express team


Posts: 7225
Joined: 2004-07-05
Hi Esteban.

Why MailItem.EntryID doesn't suit you?
Posted 23 Mar, 2006 12:00:30 Top
Esteban Astudillo




Posts: 146
Joined: 2006-02-27
Well, for starters I need a way to identify each opened Inspector, regardless of the Item type (Mail, Calendar, Task, etc). I assumed (wops, I didn't check this) that the EntryID would be available only to mail items.

In any case, I had a problem with the EntryID property when dealing with mail items in that it doesn't exist if this is a new mail message. I read in this forum that you can save the item and will create it, however that creates the problem of having to remove it from the Drafts folder if the action is cancelled, and then there is the issue with the Exchange server.

All I need is something like the Tag property for the Inspector. Thanks for the interest though.
Posted 23 Mar, 2006 12:15:02 Top
Sergey Grischenko


Add-in Express team


Posts: 7225
Joined: 2004-07-05
Esteban, what about a collection of instances of Outlook inspectors. It can be a collection (e.g. SortedList class) that you can modify in the NewInspector event handler.
Posted 23 Mar, 2006 12:46:04 Top
Esteban Astudillo




Posts: 146
Joined: 2006-02-27
I thought about that. I would need to store the Inspector instance as one of the members of the object I store in the collection to be able to remove it from the list once it is closed. Yeah..

But I think I found a better solution. It seems that this always returns a unique value (code from my NewInspector event handler):

Outlook._Inspector oInspector = inspector as Outlook._Inspector;
string sId = oInspector.GetHashCode().ToString();

I will try this approach now. Thank you for your recommendations anyway Sergey!
Posted 23 Mar, 2006 13:04:03 Top
Sergey Grischenko


Add-in Express team


Posts: 7225
Joined: 2004-07-05
Esteban, this is the same thing as an instance of Outlook inspector.
The fact is that the Equals method of the Object class works through the GetHashCode method.
Posted 23 Mar, 2006 17:56:29 Top
Esteban Astudillo




Posts: 146
Joined: 2006-02-27
I didn't know that about the Object's Equals method. Thank you for the info.

Posted 23 Mar, 2006 18:01:00 Top