Here is the basic example of converting HTML file into Word document.
HTML
<asp:Button ID="btnExport" runat="server" Text="Export" OnClick="ExportToWord" />
Code
Namespaces
Imports System.IO
VB.Net
Protected Sub ExportToWord(ByVal sender As Object, ByVal e As EventArgs) Handles btnExport.Click
Dim texts As String = File.ReadAllText("D:\Files\Index.html")
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment;filename=ExportedHTML.doc")
Response.Charset = ""
Response.ContentType = "application/vnd.ms-word"
Response.Output.Write(texts)
Response.Flush()
Response.[End]()
End Sub
Screenshot
HTML File
![](https://i.ibb.co/NggJ3m8j/HTML-Page.png)
Exporting
![](https://i.ibb.co/35Z9YSmN/demo-gif.gif)
Exported Word Document
![](https://i.ibb.co/6RW3QMZf/Exported-Word.png)
Glad to assist!