6

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 2

3

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

Sign up to request clarification or add additional context in comments.

2 Comments

But it will issue a warning on load, at least in Excel 2010
It does fill the excel sheet except few columns contain hyperlinks :(.
0

You can also use HtmlAgilityPack to parse the e-mail and EPPlus to write to Excel (only 2007/2010 xlsx version).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.