Question

My Outlook add-in handles NewInspector event of the Inspector object, in order to display a custom form for the mail item.

I can get EntryID of the CurrentItem of the Inspector object which is passed as a parameter of the event. But, the problem is that the EntryID of the current mail item is shorter than it should be, and is unknown. I know every EntryID of every mail item that was created, and I can see that specific mail item has a wrong EntryID.

What is wrong?

Was it helpful?

Solution

The idea is to remember every EntryID of the MailItem that was created by an add-in, so that it can be treated differently later. Problem was that EntryID of the item opened by an Inspector was the short one, and not in the list of remembered ids, although it should be.

Few lines of code where I was creating mail item were:

item.Save();
item.Move(some_folder);
items_list.Add(item.EntryID);

Folder 'some_folder' is inside of external non-default PST, so mail item gets new EntryID. I changed those lines to:

item.Save();
item = (Outlook.MailItem)item.Move(some_folder);
items_list.Add(item.EntryID);

Now, item has a new EntryID, which can be found later.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top