title: Creating a Word document in Coldfusion - how to have pagenumbering?
body: <p>I am creating a Word format .doc using the following code, then cfheader and cfcontent to serve. All is good but I need to be able to place dynamic information in the header (or footer), or automatic pagenumbering would be a second best option. </p>
  
  <p>How should I modify the code?</p>
  
  <pre><code>&lt;cfsavecontent variable="myDocument"&gt;
  &lt;html xmlns:w="urn:schemas-microsoft-com:office:word"&gt;
  &lt;!--- Head tag instructs Word to start up a certain way, specifically in
  print view. ---&gt;
      &lt;head&gt;
          &lt;xml&gt;
           &lt;w:WordDocument&gt;
              &lt;w:View&gt;Print&lt;/w:View&gt;
              &lt;w:SpellingState&gt;Clean&lt;/w:SpellingState&gt;
              &lt;w:GrammarState&gt;Clean&lt;/w:GrammarState&gt;
              &lt;w:Compatibility&gt;
               &lt;w:BreakWrappedTables/&gt;
               &lt;w:SnapToGridInCell/&gt;
               &lt;w:WrapTextWithPunct/&gt;
               &lt;w:UseAsianBreakRules/&gt;
              &lt;/w:Compatibility&gt;
              &lt;w:DoNotOptimizeForBrowser/&gt;
           &lt;/w:WordDocument&gt;
          &lt;/xml&gt;
      &lt;/head&gt;
  &lt;body&gt;
      Regular HTML document goes here
      &lt;!--- Create a page break microsoft style (took hours to find this) 
  ---&gt;
      &lt;br clear="all"
  style="page-break-before:always;mso-break-type:page-break" /&gt;
      Next page goes here
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;/cfsavecontent&gt; 
  </code></pre>