Redemption side effects

  • Thread starter Thread starter Mike Lindeboom
  • Start date Start date
M

Mike Lindeboom

I am using redemption to read a BCC field on a mailitem without
getting the user security prompt. In order to read the BCC field using
the SafeMailItem object I must first save the original mailitem. Now I
have a Draft of the email when none was requested by the user. What is
the best way to delete the draft while trying to maintain the default
outlook behavior (prompting the user to keep or delete the draft).
 
Trap the MailItem.Write event:
1. set a global variable (say, bSaving)
2. Call MailItem.Save
3. Trap the MailItem.Write event. If the variable from # 1 is set, you know
you got the event because you explicitly called Save
4. Reset the global variable from #1

If MailItem.Write event is ever called without the global flag set, you know
that the user explicitly saved the message. If not, it means you need to
delete the message afterwards.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
I am not sure this will help me. The original MailItem may have already
been saved in the draft folder. So after I use the Redemption api to
look at BCC I have saved a new copy over the original draft. If I delete
the MailItem from the draft folder I may also be deleting a MailItem the
user wanted to hold onto. Also if I delete the MailItem while my custom
form is visible the form closes. There must be an easier way. All I
wanted to do was read the state of BCC.

thanks
Mike
 
I am not sure this will help me. The original MailItem may have already
been saved in the draft folder. So after I use the Redemption api to
look at BCC I have saved a new copy over the original draft. If I delete
the MailItem from the draft folder I may also be deleting a MailItem the
user wanted to hold onto. Also if I delete the MailItem while my custom
form is visible the form closes. There must be an easier way. All I
wanted to do was read the state of BCC.

thanks
Mike
 
There is no easier way, sorry. Everybody (including MS) suffers from this
problem.
You don't need to delete the message if it already existed before (check
EntryID) before calling Save.

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