Discussion:
MailItem SaveAs
(too old to reply)
Koen Verwimp
2008-09-19 21:42:01 UTC
Permalink
Hello,

When I save a mail to MSG file programmatically with SaveAs on MailItem, I
can't read the PR_BODY property afterwards. I tried also with Outlook Spy to
read that propery, but the PR_BODY property is empty. Opening the MSG file in
outlook displays the body, but can't the property PR_BODY property.

After dragging it into my Inbox again, PR_BODY is filled again. The binary
format is also not the same if I save the mail as MSG programmatically versus
File->Save in Outlook. After saving the mail via File->Save in outlook ...
the PR_BODY is available.

What is happening here with SaveAs programmatically?

thanks,
Koen
Dave Vespa [MSFT]
2008-09-20 23:08:01 UTC
Permalink
I think you are seeing the results of Outlook's "Best Body" logic. Outlook
could store the body in three locations:

PR_BODY
PR_BODY_HTML
PR_RTF_COMPRESSED (which could contain RTF, HTML, or Plain text)

Outlook computes the "Best Body" on the fly. What could be happening here
is that the body is actually stored in another one of the other properties of
the message.

I would use MFCMAPI to view the MSG file and look at the addtional
properties to find which property it could be in.

http://www.codeplex.com/mfcmapi

Dave
Post by Koen Verwimp
Hello,
When I save a mail to MSG file programmatically with SaveAs on MailItem, I
can't read the PR_BODY property afterwards. I tried also with Outlook Spy to
read that propery, but the PR_BODY property is empty. Opening the MSG file in
outlook displays the body, but can't the property PR_BODY property.
After dragging it into my Inbox again, PR_BODY is filled again. The binary
format is also not the same if I save the mail as MSG programmatically versus
File->Save in Outlook. After saving the mail via File->Save in outlook ...
the PR_BODY is available.
What is happening here with SaveAs programmatically?
thanks,
Koen
Koen Verwimp
2008-09-22 12:41:00 UTC
Permalink
PR_RTF_COMPRESSED is filled!

Thanks,
Koen
Post by Dave Vespa [MSFT]
I think you are seeing the results of Outlook's "Best Body" logic. Outlook
PR_BODY
PR_BODY_HTML
PR_RTF_COMPRESSED (which could contain RTF, HTML, or Plain text)
Outlook computes the "Best Body" on the fly. What could be happening here
is that the body is actually stored in another one of the other properties of
the message.
I would use MFCMAPI to view the MSG file and look at the addtional
properties to find which property it could be in.
http://www.codeplex.com/mfcmapi
Dave
Post by Koen Verwimp
Hello,
When I save a mail to MSG file programmatically with SaveAs on MailItem, I
can't read the PR_BODY property afterwards. I tried also with Outlook Spy to
read that propery, but the PR_BODY property is empty. Opening the MSG file in
outlook displays the body, but can't the property PR_BODY property.
After dragging it into my Inbox again, PR_BODY is filled again. The binary
format is also not the same if I save the mail as MSG programmatically versus
File->Save in Outlook. After saving the mail via File->Save in outlook ...
the PR_BODY is available.
What is happening here with SaveAs programmatically?
thanks,
Koen
Raju
2011-05-20 22:13:58 UTC
Permalink
Hi,

Can you please give some information why MailItem SaveAs saves empty files
for Receipt Mails(Read Receipt, Delivery Receipt)

Other Items in Pst are extracted fine

Cheers
Post by Koen Verwimp
PR_RTF_COMPRESSED is filled!
Thanks,
Koen
Post by Dave Vespa [MSFT]
I think you are seeing the results of Outlook's "Best Body" logic.
Outlook
Post by Koen Verwimp
Post by Dave Vespa [MSFT]
PR_BODY
PR_BODY_HTML
PR_RTF_COMPRESSED (which could contain RTF, HTML, or Plain text)
Outlook computes the "Best Body" on the fly. What could be happening here
is that the body is actually stored in another one of the other properties of
the message.
I would use MFCMAPI to view the MSG file and look at the addtional
properties to find which property it could be in.
http://www.codeplex.com/mfcmapi
Dave
Post by Koen Verwimp
Hello,
When I save a mail to MSG file programmatically with SaveAs on MailItem, I
can't read the PR_BODY property afterwards. I tried also with Outlook Spy to
read that propery, but the PR_BODY property is empty. Opening the MSG file in
outlook displays the body, but can't the property PR_BODY property.
After dragging it into my Inbox again, PR_BODY is filled again. The binary
format is also not the same if I save the mail as MSG programmatically versus
File->Save in Outlook. After saving the mail via File->Save in outlook
..
Post by Koen Verwimp
Post by Dave Vespa [MSFT]
Post by Koen Verwimp
the PR_BODY is available.
What is happening here with SaveAs programmatically?
thanks,
Koen
--
______________________________________
Posted from http://outlook-center.com
Outlook forums, articles, tips.
Loading...