Chickens, Eggs, EntryID, and Reply Body Text

J

Jim

Hello,

I'm still working on my Extended MAPI wrapper code to avoid the
Outlook security warning when reading objMailItem.Body.

I have initial code working and I can now read PR_BODY using EntryID.

But I have run into a chicken-and-egg problem. When 'Reply' is
selected, there is not yet any EntryID for the new item created by the
Inspector so I can't use my Extended MAPI code to read PR_BODY to see
if this is a message of interest to my Add-In.

However, objMailItem.Body *can* read the body text prior to the Save
that would create the EntryID.

So unless the security warning only occurs when reading
objMailItem.Body for an item that has not yet been Saved, then
replacing objMailItem.Body reads with calls to Extended MAPI PR_BODY
reads will not take care of everything.

I am going to start thinking about Rube Goldberg code that somehow
keeps track of previously selected mail items, stores the result of
PR_BODY reads before Reply is selected, and somehow ties that back to
the current Inspector when Reply is selected and the EntryID is found
to be empty.

Ouch.

Has anyone figured out a simple clean way to handle this? What am I
missing?

Thanks.

Jim
 
D

Dmitry Streblechenko \(MVP\)

You are not really missing anything - until the message is saved, all
modifications live in Outlook internal memory and can only be accessed using
Outlook Object Model.

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