C# 将html表格导出到excel工作表

C# 将html表格导出到excel工作表,c#,html,C#,Html,我有一个应用程序,可以创建电子邮件并发送给我的工作团队。我根据特定条件动态创建HTML表。然后,我使用outlookhtmlbody方法发送电子邮件。电子邮件工作正常 现在,一位用户问我是否可以在电子邮件中创建一个html链接,以打开一个显示相同数据的excel文件。我的问题是,有没有一种快速或简单的方法可以将我用于电子邮件的html表直接复制到excel string htmlHeader = "<table style='font-size: 12pt;'><tr>

我有一个应用程序,可以创建电子邮件并发送给我的工作团队。我根据特定条件动态创建HTML表。然后,我使用outlookhtmlbody方法发送电子邮件。电子邮件工作正常

现在,一位用户问我是否可以在电子邮件中创建一个html链接,以打开一个显示相同数据的excel文件。我的问题是,有没有一种快速或简单的方法可以将我用于电子邮件的html表直接复制到excel

 string htmlHeader = "<table style='font-size: 12pt;'><tr><th align='left'>Sedol</th><th>&nbsp;</th>" +
            "<th align='left'>Name</th><th>&nbsp;</th>"+
            "<th align='left'>Ex Date</th><th>&nbsp;</th>" +
            "<th align='left'>Div Type</th><th>&nbsp;</th>" + 
            "<th align='left'>Div Contribution</th><th>&nbsp;</th>" + 
            "<th align='left'>Div Value GBP (p)</th><th>&nbsp;</th>" +
            "<th align='left'>Nominals</th><th>&nbsp;</th>" +
            "<th align='left'>Currency</th><th>&nbsp;</th>" + 
            "<th align='left'>Country of Incorp</th><th>&nbsp;</th></tr>";    
string htmlHeader=“Sedol”+
“姓名”+
“交货日期”+
“Div类型”+
“部门贡献”+
“部门价值英镑(p)”+
“名词”+
“货币”+
“Incorp国家”;

您可以查看此链接了解格式化提示:


您可以添加标签,您的html应该或多或少可以工作。文件扩展名可能应该是.xlsx

,因为用户要求在excel电子表格中显示,所以您可以创建一个
CSV
文件