MailItem - Unique MessageID.

J

JIGNESH

1. How do i get a Unique MessageID From MailItem. I do see a property
EntryID, but it may change if message is moved to another folder.

2. How do i identify if Message was InBound or OutBound ?

- Regards
 
D

Dmitry Streblechenko

You can use the PR_SEARCH_KEY MAPI property, but it does not get chnages if
a message is moved or copied.
If it is copied, you can end up with two or more messages with the same
value of PR_SEARCH_KEY.
Why not simply treat a message moved to a different folder as old message
deleted and a brand new totally independent messaage created in the target
folder?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
J

JIGNESH

Hi Dmitry

Why i am looking for unique Message ID is because to track that this is the
same message and its have been simply moved to another folder.

We don't want to consider it as a new message, that's why unique Message ID
is important to us.

Any Clues.?

- Regards
 
R

Richard Gran

If you use Extended MAPI and uses the MAPI Advise sink, you'll be able
to get the previous Entry ID of an item when it is moved to a new folder.

See the OBJECT_NOTIFICATION structure.


Regards,
Richard
 
D

Dmitry Streblechenko

No, it is not the same message - it has a new parent . Which is really is a
message property not that different from, say, Subject.
What happens if the message is copied twice? You now have the original and
two exact copies. Can you treat them as the same message? Apparently not.
Moving a message is not at all different.
Again, you can use PR_SEARCH_KEY, but you can duplicates if the mesage is
copied.


--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top