HTML String to Word with Header and Footer (ASP.NET and VB.NET)

  • Thread starter sasikumar.gunasekaran
  • Start date
S

sasikumar.gunasekaran

I have to create a MS - Word document with header and footer from a
HTML string. I am using the below code.

Dim strHTML As String = "<html><body><br><b>hello</b><br></body></
html>"
Response.Cache.SetExpires(DateTime.Now.AddSeconds(1))
Response.Clear()
Response.AppendHeader("content-disposition",
"attachment;filename=FileName.doc")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/vnd.ms-word"
Me.EnableViewState = False
Response.Write("\r\n")
Response.Write(HttpUtility.HtmlDecode(strHTML))
Response.End()

I want to build the HTML with header and footer which will be later
converted into a MS Word with Header and Footer also if the pages got
increased.

Please help me out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top