View Single Post
 
Old 01-27-2011, 02:30 PM
equalizer700 equalizer700 is offline Windows 7 Office 2007
Novice
 
Join Date: Aug 2010
Posts: 1
equalizer700 is on a distinguished road
Default How to make page footers in html formatted .doc file?

We have a web page that dynamically creates a .doc file and opens it in MS Word. The contents of the .doc file are standard html.

It includes this:
<!--[if gte mso 9]>
<xml>
<w:WordDocument>
<w:View>Print</w:View>
<w:Zoom>90</w:Zoom>
<w:DoNotOptimizeForBrowser/>
</w:WordDocument>
</xml>
<![endif]-->
<!-- Style Definitions for Word -->
<style type="text/css">
<!--
@page Section1
{
size: 8.5in 11.0in;
margin: .5in 1.0in .5in 1.0in;
mso-header-margin: 0in;
mso-footer-margin: .5in;
mso-paper-source: 0;
}
div.Section1
{
page: Section1;
}
p.MsoFooter div.MsoFooter
{
mso-pagination:widow-orphan;
tab-stops:center 3.0in right 6.0in;
margin-bottom:.001pt;
font-size:11pt
}
--></style>....followed by standard html markup.


How would we go about adding a page footer to all the pages in this document except the first page?



This will need to work for versions of Word from 2003 to 2010, including Word for the Mac.



We used to have code that worked up to Word 2007, but that code does not seem to work on Word 2007 or 2010. The old code was the last thing on the html page and was:
</div>
<!--'This is the page footer definition
'Word marks and stores information for simple fields by means of the Span element with the
'mso-field-code style. Refer to the topic "Fields" in the Office XML & HTML Reference-->
<div style='mso-element:footer' id=f1>
<p class=MsoFooter>
<span style='mso-field-code:" FILENAME "'></span>
<span style='mso-tab-count:2'></span>
<span style='mso-field-code:" PAGE "'></span>
</p>
</div>
</body>
</html>


Can someone please help with this???
Reply With Quote