Problem setting body & attachments in OnOpen() or OnReadComplete()

  • Thread starter Thread starter robert dugal
  • Start date Start date
R

robert dugal

On an inbound message in OnOpen() my plug-in modifies the PR_BODY
property and creates some attachments then calls SaveChanges(
KEEP_OPEN_READWRITE ).
Neither the body or these attachments showup in the form but if I look
at the message with OutlookSpy the properties exist. And with
autopreview they also show up. I tried moving this code to
OnReadComplete() and now the body shows up in the form but not the
attachments. And again all properties exist in OutlookSpy.

Basically what I'm trying to accomplish is to decrypt an inbound
message when the user opens the message and when the message is closed
restore it to the encrypted state. The encrypted text will contain a
body and possibly attachments, and all must only visible to the user
while the message is open.
But I cannot get this to work in Outlook 2000.

Can anyone help me get this to work?
 
Outlook does not see any changes made using Extended MAPI until you
dereference and reopen the message. You could use the Outlook Object Model
to modify Body/attachments, but Outlook will prompt the user to save the
changes.
The real solution would be to use your own form, this way you are free to
display whetever you want.

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

For now I don't want to have to implement my own forms. So I think
I'll move the msg decoding into OnRead(). This won't give me exactly
the behavior I want but at least it will work.
 
Back
Top