Convert HTML Page to .doc, xls



public
void HTMLToOthers(string filename, string filetype)
{
if (filename.Trim() != "")
{
Response.ContentType = "application/vnd" + filetype;
Response.AddHeader("content-disposition", "attachment;filename=" + filename);
System.IO.
StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.
HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
System.Web.UI.
Page sPage = new System.Web.UI.Page();
sPage.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
}



}
Next Recommended Reading Remove HTML tags from string in c#