将HTML转换为Word文档

如何将页面HTML to word转换HTML to word文档。 例如,我有一个网页,我需要保存在word文档中。 如何将HTML页面转换为Word文档。 以及如何在word文档中插入分页符

您可以在下面找到将html转换为word的示例。

它工作正常,我在MS Office 2013Open Office上测试过它。

注意:对于在页面下方插入分页符

 

例:

 Dim StrLocLetterText As StringBuilder = New StringBuilder() Dim ObjLocHtml1 As String = "" Dim ObjLocHtml2 As String = "" StrLocLetterText.Append(ObjLocHtml1) StrLocLetterText.Append() StrLocLetterText.Append(ObjLocHtml2) HttpContext.Current.Response.Clear() HttpContext.Current.Response.Charset = "" HttpContext.Current.Response.ContentType = "application/msword" HttpContext.Current.Response.AddHeader("Content-Disposition", "inline;filename=" +  + ".doc") HttpContext.Current.Response.Write(StrLocLetterText) HttpContext.Current.Response.End() HttpContext.Current.Response.Flush()