-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: dreams
Message 1 in Discussion

 Hi  Everyone,               I am facing problem in adding footers in ms-word. 
I have used this below code, but it  print the document along with footer. i 
want to remove the text in the document. can any help me in this regard.   
Thanks in advance, Dreams Partial Class ms_word
    Inherits System.Web.UI.Page     Protected Sub Page_Load(ByVal sender As 
Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim strDocBody As StringBuilder = New StringBuilder("")
        Try
            strDocBody.Append("<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'>" + "<head>")
            strDocBody.AppendLine("<!--[if gte mso 9]>" + "<xml>" + 
"<w:WordDocument>" + "<w:View>Print</w:View>" + "<w:Zoom>100</w:Zoom>" + 
"<w:DoNotOptimizeForBrowser/>" + "</w:WordDocument>" + "</xml>" + 
"<![endif]-->")
            strDocBody.AppendLine("<style> @page" + "{size:8.5in 11.0in; 
mso-first-footer:ff1; mso-footer: f1;" + " margin:0.75in 0.50in 0.75in 0.50in ; 
" + " mso-footer-margin:.5in; mso-paper-source:0;}" + " div.Section1" + " 
{page:Section1;}" + "p.MsoFooter, li.MsoFooter, div.MsoFooter{margin:0in; 
margin-bottom:.0001pt; mso-pagination:widow-orphan; tab-stops:center 3.0in 
right 6.0in; font-size:12.0pt; font-family:'Arial';}" + "</style>" + "</head>")
            strDocBody.AppendLine("<body lang=EN-US style='tab-interval:.5in'>" 
+ "<div class=Section1>" + "<div style='mso-element:footer' id=f1> " + "Page 
<span style='mso-field-code: PAGE '><span 
style='mso-no-proof:yes'>1</span></span> of <span style='mso-field-code: 
NUMPAGES '></span>" + " <span style='mso-tab-count: 12'> <span 
style='mso-field-code: DATE '></span> " + "</div>" + "</div> </body></html> ")
            Response.AddHeader("Content-Type", "application/msword")
            Response.AddHeader("Content-disposition", "attachment; 
filename=mydoc.doc")
            Response.Charset = ""
            Response.Write(strDocBody.ToString)
        Catch ex As Exception
            Response.Write(ex.Message)
        End Try
    End Sub
End Class


-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to