I'm writing a service that cleans files by removing all malicious content. I'm using Interop Excel & Word api's like this:
Excel
var excelApp = new Microsoft.Office.Interop.Excel.Application();
excelApp.Visible = false;
excelApp.AutomationSecurity = Microsoft.Office.Core.MsoAutomationSecurity.msoAutomationSecurityForceDisable;
try
{
var workbook = excelApp.Workbooks.Open(fileToClean.InputFileName);
Word
var wordApp = new Microsoft.Office.Interop.Word.Application
{
Visible = false,
AutomationSecurity = Microsoft.Office.Core.MsoAutomationSecurity.msoAutomationSecurityForceDisable
};
try
{
var wordDoc = wordApp.Documents.Open(fileToClean.InputFileName, false, true);
I'm trying to find a similar way to open .eml Outlook files. I can't find any way of opening a .eml file using the Outlook Interop.