I have html table in Microsoft.Office.Interop.Outlook.MailItem body and I just need to fill excel sheet with this table using C# for desktop application. Could any one help me in this regard. Thanks
2 Answers
A quick and dirty way:
File.WriteAllText(@"C:\Temp\Table.xls", mailItem.Body);
Excel will open it even though the file does not contain a valid xls document
2 Comments
Stefan Steiger
But it will issue a warning on load, at least in Excel 2010
user607374
It does fill the excel sheet except few columns contain hyperlinks :(.
You can also use HtmlAgilityPack to parse the e-mail and EPPlus to write to Excel (only 2007/2010 xlsx version).