Question: I have a C# application that reads .msg files and extracts the body and the attachments. But when I try to load a .eml file the application crashes. I am loading the files like this:

```
MailItem mailItem = (MailItem)outlookApp.CreateItemFromTemplate(msgFileName);
mailItem.SaveAs(fullFilename, OlSaveAsType.olHTML); // save body in html format
for(int i = 0; i < mailItem.Attachments.Count; i++)
    mailItem.Attachments[i].SaveAsFile(filename); // save attachments

```

This works fine with .msg files, but it doesn't work for .eml files. I don't understand why .eml files don't work, because I can open .eml files in Outlook 2010.

How can I load .eml files using the Outlook [Primary Interop Assembly](http://msdn.microsoft.com/en-us/library/aax7sdch.aspx)?

Answer: 
Try this sample code [Easily Retrieve Email Information from .EML Files](http://www.codeproject.com/KB/office/EML_Reader.aspx)
Although **Outlook can open EML files**, there is **no way to do it programatically** only with VBA. So I created this VBA macro which loops through some folder and opens each EML file using ***SHELL EXEC***. It may take a few milliseconds until Outlook opens the EML file, so the VBA waits until something is open in ActiveInspector. Finally, this email is copied into some chosen folder, and (in case of success) the original EML file is deleted.

See my complete answer (and code) here:
<https://stackoverflow.com/a/33761441/3606250>