Correct "NumPages"?
Report abuse
Thank you.
Reported content has been submitted
If you're using the "Different First Page" option in the Header & Footer Tools tab, that has no effect on the result of the NumPages field -- although the header or footer on the first page may appear different from the header or footer on other pages, the page count is not changed.
However, if you've inserted a section break and restarted the page numbering in the section following the break, then the page number on the last page of the document won't be the same as the total number of pages displayed by the NumPages field. There are two possible field constructions that will display the last page's number.
The simpler method is to insert a bookmark (or a Set field, which creates a bookmark) on the last page of the document. Let's assume you name the bookmark LastPage, although it can be any valid bookmark name. Then, in a header or footer, you can replace the NumPages field with the field {PageRef LastPage}. That will display the same number as would a {Page} field on the last page. The drawback of this simple procedure is that a bookmark, being invisible, is easily deleted by accident if the text containing it is deleted or overwritten; then the PageRef field will display an error message.
The other method depends on knowing exactly the number of pages in the first section, before the section break. Let's say the first section (cover page, table of contents, etc.) has 5 pages. Then you can edit the header/footer to change the NumPages field as follows:
- Insert an equal sign before the NumPages field.
- After the NumPages field, insert a minus sign (use the hyphen key) and the number of pages in the first section (in this example, type the number 5).
- Select the whole thing, from the equal sign to the number, and press Ctrl+F9 to insert a pair of field brackets around it. It should now look like {={NumPages}-5}.
- Press F9, or right-click the field and click Update Field.
This method doesn't use a bookmark that could be deleted, but its drawback is that the result will be wrong if the number of pages in the first section changes, for example if the table of contents grows longer.
You could combine the two methods, putting the bookmark at the end of the first section instead of the end of the document, and then making the field construction {={NumPages}-{PageRef LastPage}}.
https://jay-freedman.info
Report abuse
Thank you.
Reported content has been submitted
26 people found this reply helpful
·Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Jay's solution works if you follow the directions. Following his directions, if you don't have a Section break, you could use a field coded as:
{={NumPages}-1 \#0}
Note: The field brace pairs (i.e. '{ }') for the above example are created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practicable to add them via any of the standard Word dialogues.
Paul Edstein
(Fmr MS MVP - Word)
Report abuse
Thank you.
Reported content has been submitted
4 people found this reply helpful
·Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Report abuse
Thank you.
Reported content has been submitted
1 person found this reply helpful
·Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Paul Edstein
(Fmr MS MVP - Word)
Report abuse
Thank you.
Reported content has been submitted
2 people found this reply helpful
·Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Question Info
Last updated April 14, 2025 Views 17,924 Applies to: