Search code examples
xmlxsltms-wordxslt-1.0wordml

Display number of pages in Word ML


I want to display total number of pages on the first page of word document, that is formin with WORD ML template. I know how to display current page number and total number of pages in a footer. It looks like:

<w:ftr w:type="odd">
     <w:p>
        <w:r wsp:rsidRPr="007924AD">
           <w:rPr>
              <w:rStyle w:val="a6" />
                 <w:color w:val="777777" />
           </w:rPr>
           <w:instrText> PAGE </w:instrText>
         </w:r>
    </w:p>
</w:ftr>

But how can I display PAGE or NUMPAGES not in a footer but in the body of a page? Is it possible?


Solution

  • I solved the problem. The field NUMPAGES is forming correctly but the number of pages is not updated automatically. You must force it update in one of the following ways:

    click on the autofield and and select update field from the context menu print preview the document - the field will be updated save the document as pdf, for example