Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MAPI MessageID

138 views
Skip to first unread message

amit dey

unread,
Dec 30, 2001, 1:20:20 PM12/30/01
to
Hello all,
In my Outlook addin, I setup a sink to receive MAPI notification.for
newmail. How do I get an incoming message's MessageID? Basically I want
unique identification of any new message so that I can retrieve the message
details later from the msgstoreWill any alternative properties like
EntryID(PR_ENTRYID) and store's entryid(PR_STORE_ENTRYID) also work?
TIA.
Wish you all a happy 2K2.


Mike Timms

unread,
Dec 30, 2001, 11:57:31 PM12/30/01
to
amit,


"amit dey" <vcdev...@hotmail.com> wrote in message news:<OdZiOfWkBHA.1860@tkmsftngp05>...

The NewMail event doesn't pass the actual item that was received.
Some alternatives to consider:

1. Register for the AddItem event against the Inbox folder.

This event does pass the associated item. You can then retrieve a
string representation of the PR_ENTRYID through the item.EntryID
property. PR_STORE_ENTRYID is available via item.Parent.StoreID.

2. Use the Redemption library.

See: http://dimastr.com/redemption. As well as overcoming limitations
imposed by the Outlook security patch, it includes a NewMail event
that also passes the associated item, and provides access to Extended
MAPI properties not available through the Outlook object model.

- Mike

Thomas Quester

unread,
Jan 2, 2002, 7:44:12 AM1/2/02
to
Hi,

The only more or less unique field is the entry ID. However it will change
if you move the message to another store. If you can open the message with
given entryid/storeid you are sure to have the message, if you can not open
it, you can not be sure if the message does not any more exists or is moved.
To be sure, it is better to create a field containing a guid, which can be
used later in searching.

Thomas Quester
www.outlookfolders.com

"amit dey" <vcdev...@hotmail.com> wrote in message
news:OdZiOfWkBHA.1860@tkmsftngp05...

AJ

unread,
Jan 2, 2002, 8:27:29 AM1/2/02
to
Actually, that's a bit incorrect. There are a few "ID" fields, some are
more unique than others.

The "EntryID" will change if the email moves from folder to folder, even
within the same MsgStore. The best ID I've found for tracking emails is
PR_SEARCH_KEY. It is supposedly "globally unique"...and from what I've seen
it seems to be.
Look in MSDN at:
MSDN Home > MSDN Library > Platform SDK: MAPI > MAPI Properties

--AJ

"Thomas Quester" <tque...@msn.com> wrote in message
news:uHmR#v4kBHA.1760@tkmsftngp03...

Ken Slovak - [MVP - Outlook]

unread,
Jan 2, 2002, 9:21:42 AM1/2/02
to
Even PR_SEARCH_KEY will change I've found. I create a user defined
field and use the CreateConversationIndex method of a CDO Session to
create a unique key field that will stay the same no matter where a
message is moved.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm

"AJ" <a-no-space-here-weber at home dot com> wrote in message
news:uo8a7F5kBHA.568@tkmsftngp07...

AJ

unread,
Jan 2, 2002, 9:49:11 AM1/2/02
to
That's a bit different than what the MAPI SDK says...but I believe you.

Can you elaborate on how you do that? Where are you storing the data, and
how is it formatted?

--AJ

"Ken Slovak - [MVP - Outlook]" <kens...@mvps.org> wrote in message
news:#B2$Wj5kBHA.396@tkmsftngp02...

Ken Slovak - [MVP - Outlook]

unread,
Jan 2, 2002, 9:58:51 AM1/2/02
to
I just use CreateConversationIndex to create a string and create a
string property (Field) using the Add method of the Fields collection
of that item.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm

"AJ" <a-no-space-here-weber at home dot com> wrote in message

news:#26Nlz5kBHA.2388@tkmsftngp02...

amit dey

unread,
Jan 5, 2002, 7:23:50 PM1/5/02
to
Thanks a lot, Thomas.
But if I'm not concerned about message being moved to another folder and
only interested in the message that comes in(kind of like an email
notification) then PR_ENTRYID and PR_STORE_ENTRYID props should work for me?

"Thomas Quester" <tque...@msn.com> wrote in message
news:uHmR#v4kBHA.1760@tkmsftngp03...
0 new messages