Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Html Export to word
just call this function in the code sample from any aspx page say on export to word button click..
u see the html page contents rendered in a msword format.
// For Direct Exporting From HTML to Word
// Call this function on Button Click , pls include the required system.web namespaces
public static void HtmlExportToWord()
{
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.ContentType = "application/vnd-ms.word";
///uncomment the 1st line if you want to open directly in IE and comment the 2nd line
//HttpContext.Current.Response.AddHeader("content-disposition", "inline; filename=ExportWord.doc");
HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=ExportWord.doc");
}
Comments
- Anonymous
October 25, 2007
PingBack from http://msdnrss.thecoderblogs.com/2007/10/25/html-export-to-word-3/