Header problem in word document print layout

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krishnagovindaraj
    New Member
    • Aug 2007
    • 10

    Header problem in word document print layout

    Hi,
    I have to create word document with header and footer..its working in web layout.In Print Layput,the header is displayed two times..Plz give me the solution...its very urgent..

    Code:
     
    strBody = "<html xmlns:o='urn:schemas-microsoft-com:office:office' " & _ 
    "xmlns:w='urn:schemas-microsoft-com:office:word'" & _ 
    "xmlns='http://www.w3.org/TR/REC-html40'>"
    strBody = strBody + "<!--[if gte mso 9]>" & _
    "<xml>" & _
    "<w:WordDocument>" & _
    "<w:View>Print</w:View>" & _
    "<w:Zoom>100</w:Zoom>" & _
    "<w:DoNotOptimizeForBrowser/>" & _
    "</w:WordDocument>" & _
    "</xml>" & _
    "<![endif]-->"
     
    strBody = strBody + "<style>" & _
    "<!-- /* Style Definitions */" & _
    "p.MsoFooter, li.MsoFooter, div.MsoFooter" & _
    "{margin:0in;" & _
    "margin-bottom:.0001pt;" & _
    "mso-pagination:widow-orphan;" & _
    "tab-stops:center 1.0in right 1.0in;" & _
    "font-size:10.0pt;}"
     
     
     
    strBody = strBody + "@page Section1" & _
    " {size:8.8in 12.0in; " & _
    " mso-header: h1;" & _
    " mso-footer: f1;" & _
    " mso-footer-margin:.4in; mso-paper-source:0;}" & _
    " div.Section1" & _
    " {page:Section1;}" & _
    "-->" & _
    "</style></head>"
    strBody = strBody + "<body>"
    'strBody = strBody + "<div>"
    strBody = strBody + "<div class=Section1 style='mso-element:header' id=h1>" & _
    " <p class=MsoHeader align=left>" & _
    " <span style='mso-tab-count:2'></span><span style='mso-field-code:'>" & _
    "<table width='98%' border='1' align = 'center'>" & _
    "<tr bgcolor=white>" & _
    "<td width=33% align=center><img border=0 src='../../../images/tele.jpg'></td>" & _
    "<td width=33% align=center>" & _
    "<font color=blue face=verdana size=5>Built Release Form</font>" & _
    "</td>" & _
    "<td width=33% align=center>Page " & _ 
    "<span style='mso-field-code:"" Page ""'></span>" &_ 
    "</td>" & _
    "</tr>" & _
    "</table>" & _
    "</span>" & _
    " </p></div>"
    strBody = strBody + lPageVar 
    strBody = strBody + "<div style='mso-element:footer' id=f1>" & _
    " <p class=MsoFooter align=center>" & _
    " <span style='mso-tab-count:2'><span style='mso-field-code:'>" & strFooter & "</span>" & _
    " </p></div>" & _
    "</body>"
    Response.Buffer = True
    Response.ContentType = "application/vnd.ms-word"
    Response.AddHeader "content-disposition", "inline; filename = BuildReleaseForm.doc"
    %>
     
    <%
    Response.Write(strBody)
    Response.End
     
    %>
    Thanks
    Krish
    Last edited by DrBunchman; Apr 25 '08, 11:36 AM. Reason: Added code tags - note the # button
Working...