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

Discussion in 'ASP .Net' started by sasikumar.gunasekaran@gmail.com, Apr 1, 2008.

  1. Guest

    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.
     
    , Apr 1, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UnVkeSBEZWl0cmljaw==?=

    Streaming Word to browser on SSL supresses header and footer

    =?Utf-8?B?UnVkeSBEZWl0cmljaw==?=, Dec 2, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    354
    =?Utf-8?B?UnVkeSBEZWl0cmljaw==?=
    Dec 2, 2004
  2. ramin
    Replies:
    0
    Views:
    460
    ramin
    Oct 25, 2004
  3. Raj Vanjara
    Replies:
    5
    Views:
    1,873
    Lawrence D'Oliveiro
    Feb 4, 2011
  4. Henrik
    Replies:
    1
    Views:
    460
    Ken Cox [Microsoft MVP]
    Jul 6, 2006
  5. fjanon
    Replies:
    5
    Views:
    388
Loading...

Share This Page