Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting HTML table to excel sheet using C#

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

like image 936
user607374 Avatar asked Feb 08 '11 00:02

user607374


1 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

like image 170
vc 74 Avatar answered Sep 23 '22 15:09

vc 74