Saving mail messages as html or rtf

S

Simon Kravis

I need to save all the mail messages in an Outlook 2002 folder in a
format which preserves text formatting and is readable by other
programs. Checking the MailItem.SaveAs method it provides the options
olDoc, olHTML, olMSG, olRTF, olTemplate, olTXT, olVCal, or olVCard.

Using folder with messages and the olRTF option

Dim M As Outlook.MailItem
For Each M In F3.Items
sSaveName = "D:\Data\TED\Mail Analyser\WBAA Posts\" & i & ".rtf"
M.SaveAs sSaveName, olRTF
i = i - 1
Next M

I get the runtime error "Could not complete operation. One on more
parameter values are not valid" on most of the files.

Changing the SaveAs option to olHTML, I find that files that do not
save as RTF will save as HTML, and those which will save as RTF will
not save as HTML.

I notice the Save As options may include either html or rtf in the
message window. How is Outlook deciding this? Is it possible to save
in just one format?

Simon Kravis
 
S

Sue Mosher [MVP-Outlook]

You can only save as RTF if the original message was in RTF. Same thing for
HTML. Use the BodyFormat property to determine the format before saving.
 

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