Outlook Message Saved as RTF

M

Mark Eastom

I've come across batches of Outlook messages that were for some reason saved
from the original PST files as RTF files. Most of the original messages
had file attachments.

The RTF files, if opened within MS-Word display the file attachments as OLE
Embedded objects.

If you right click on them you can save them with their original name /
content.


I'm trying to automate the process of extracting and saving the attachments
from the RTF files with their original names by using MS-Word's automation
objects.

When you get down to locating the object within a field in the document its
"OLEFomat" object's "Object" member is always Null / Nothing with an
automation error. So you can't get at the Outlook.Attachment object to get
the original name and call the SaveAs method.

It appears to be getting "confused" by its ProgID beng "Outlook.FileAttach",
yet the attached file in this case is a MS-Word document.

The Edit / Open methods on the OLEFormat object can be called, however,
those pop up the SaveAs dialog and require user intervention. They might
also behave unexpectedly if the system that is attempting to extract / save
the attached files doesn't have an application installed that can
successfully open attachments all potential types.

The DoVerb method on the OLEFormat object for a Save(As) if it is present
would have similar problems to the Open / Edit methods.


Has anyone else run into this type of situation and have clues on how one
might go about extracting the attached files from the RTF files
automatically (while hopefully retaining their original file names) ?


Are there any tools / controls available that can parse the RTF stream to
grab the object / objdata contents and convert them it all to the original
file attachment?
 

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