creg
creg

Reputation: 164

How to obtain the ID of the origin inbox by the mail item?

Is there a way to obtain a (unique) inbox id by the mail item, maybe over one of the mailitem properties:

https://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.mailitem_properties.aspx

I have in my Outlook 2010 a mail that was moved in the deleted items folder. Now I am looking for the source where did it come from (my private inbox or the shared inbox).

Upvotes: 1

Views: 174

Answers (2)

Aliaksei Futryn
Aliaksei Futryn

Reputation: 461

I want to provide you my solution for solve this problem. In this case you can subscribe to event "BeforeItemMove" of folder and when event occured you need check a folder name. If folder name is "Delted Items" you can write information about your inbox (private or shared) in "UserProperties" of mail item. In addition to that you need subscribe to event "ItemAdd" of delete folder. As a result you will receive information about your inbox.

Upvotes: 0

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66276

When an items is moved to a different folder, it retains no knowledge about its previous parent. Foo all practical purposes, it is a completely new item.

Upvotes: 1

Related Questions