Convert HTML To Word Document

后端 未结 1 439
醉梦人生
醉梦人生 2021-01-07 09:35

How to convert page HTML to word document. For example i have a web page which i need to save in word document. How to convert HTML Page to Word Document. And h

1条回答
  •  旧时难觅i
    2021-01-07 09:55

    Below you can find an example to convert html to word.

    It works fine and i had tested it on MS Office 2013 and Open Office.

    Note : For page break insert below line


    Example:

    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()
    

    0 讨论(0)
提交回复
热议问题