“Page X of Y” gives wrong numbers

Article contributed by Dave Rado and Suzanne S. Barnhill

When you use the "Page X of Y" AutoText (or building block in Word 2007) in your header or footer, and it seems to work okay, but when you re-open or print the document, you see "Page 1 of 1," "Page 2 of 2," and so on (or, worse still, “Page 1 of 1,” “Page 2 of 1,” etc.), you have the "Page X of Y" bug.

If you are using Word 2000 or later

Upgrade to the latest Service Release for your product. To do this, click here and then look for and click the Office Update -- Check for updates link. These free upgrades can also be obtained from Microsoft on CD. Note: Some versions of Office on some operating systems will require you to put the original product CD from which you installed Office in during installation. Try the update: if you get a message saying it cannot install because you have not provided the original CD, unfortunately there is nothing you can do about this: you need to find the original CD or buy a new copy.

Workarounds when the updates do not solve the problem

The updates do not fix the problem in all cases or for all documents (and we do not know why). If you have applied the latest service release for your version of Word, and you still have the Page X of Y problem, one of the solutions mentioned below may work for you:

  1.  Reverse the print order. This forces Word to paginate the entire document before printing the first page. You can do this at Tools | Options | Print in Word 2003 and earlier or at Office Button | Word Options | Advanced | Print in Word 2007. This works for almost everyone but is a major pain. If your printer has its own “reverse print order” hardware setting, you can, in effect, reverse twice, thus saving yourself the trouble of re-collating; but this is hardly practical if it's a network printer. Some printers (those that output face up) reverse the print order by default, and the Page X of Y problem is rare with such printers.

  2. Switch into Print Preview and back, twice if necessary. Make sure you have the “Update fields” option checked at Tools | Options | Print (Office Button | Word Options | Display in Word 2007). This works for some but is not practical in a corporate environment – it's too easy to forget to do it. In any case, it is probably a red herring since Word updates all fields in headers and footers before printing even with this option disabled.

  3. In addition to (2)., try clearing the check box for “Background printing” (Tools | Options | Print) or “Print in background” (Office Button | Word Options | Advanced | Print). This works for more people than (2) on its own.

  4. Some users report that hiding nonprinting characters (toggle the Show/Hide ¶ button to Hide) helps. Same comment as (2).

  5. Instead of using a NUMPAGES field, use a PAGEREF field that references a bookmark at the very end of the document.

  6. Or if you're using the SECTIONPAGES field, replace each with a PAGEREF field that references a bookmark at the very end of that section

  1. Write an Add-in that intercepts the FilePrint and FilePrintDefault commands and implements (5). automatically. For a corporate environment, this was really the only practical solution before the release of Service Release 1 for Word 2000.

Word 97

Whereas in Word 2000, before Service Release 1, the numbers displayed correctly but printed incorrectly, in Word 97, it is usually the other way around – the numbers print fine for most people but display on every page as Page x of 1 – that is, provided you use the NUMPAGES field. The SECTIONPAGES field didn't work at all in Word 97 for most people up to SR-2, even when printing.

To fix the printing problem, you can upgrade to the Word 97 'Leap Year Fix' (so-called – it's really SR-3) – but that won't fix the screen display problem.

The most reliable method of fixing the display problem is to switch to Normal View and back to Page Layout View. You can even write a little macro to do this automatically whenever a document is opened:

Sub AutoOpen()
Application.ScreenUpdating = False
With ActiveDocument.Windows(1).View
   .Type = wdNormalView
   .Type = wdPageView
End With
Application.ScreenUpdating = True
End Sub

Of course that won't help when the user adds more text and the document goes onto more pages – but you could create an “Update page numbers” button on the toolbar to run the same macro.

Microsoft Knowledge Base articles

The Total Number of Pages field (NUMPAGES) does not print correctly in Word 2000

FIX: The result of the SectionPages field or NumPages field does not print correctly in Word 2000

The NUMPAGES field may not print as expected after you install Word 2000 Service Pack 3

WD97: Incorrect SectionPages or NumPages Field When Printed