Outlook2003 saving emmbedded images in c#

N

Nicato

I have Outlook mails, where graphic is embedded in the mail. So it does not
show up as attachment. It was created by a screen shot utility with
copy-paste into a mail. When I receive this mail I directly see this graphic.
Same is true for some table copied from word etc.
However, I want to programmatically save the body of the mail and of the
images (/or word documents).
To save the body, no problem with .net by doing something similar like
mailItem.SaveAs("myfile.html", OlSaveAsType.olHTML);
I just wanted to have it as HTML. Thats fine.
Now I loop through the attachments:

for(int i = 1; i <= mailItem.Attachments.Count; i++)
{
string fn = mailItem.Attachments.FileName ;
mailItem.Attachments.SaveAsFile( fn );
}

thats fine. Point is, that the filename is "Untitled Attachment".
So I don't know what file type it is, if it where a bmp, I could manually
add the ".bmp" extension on it. But as long as I don't know the type, how
could I assign an extension.
So finally my qustion: I there a way to find out what type the attachment
is, so that I can add the fileextension on it?
 

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