Effective February 22, 2024, Google Groups will no longer support new Usenet content. Posting and subscribing will be disallowed, and new content from Usenet peers will not appear. Viewing and searching of historical data will still be supported as it is done today.
Dismiss

Total Page Number Minus Number of Pages in Front Matter

4,502 views
Skip to first unread message

Rhonda

unread,
Apr 15, 2010, 10:07:02 AM4/15/10
to
I have a document with 4 pages of front matter (cover page and table of
contents) and then 42 pages of text in the body of the document. I have the
pages of the body numbered "Page X of Y", but the Y is the total pages of the
entire document (46) and I want it to represent Y minus the pages in the
front matter (42) i.e. I want all my body pages to actually say "Page 'X 'of
42" not "Page 'X' of 46". Of course I could manually enter the number 42 in
place of Y, but the document will eventually be updated and additional pages
will result so I want it automated. (If the solution involves fields and
formulas, go slow I have no idea how to create new ones!)

Thanks so much!
Rhonda

Suzanne S. Barnhill

unread,
Apr 15, 2010, 11:02:10 AM4/15/10
to
If you know the number of pages in the front matter (and it will not
change), then you can use Page { Page } of { = { NumPages } - x }, where x
is the number of pages in the front matter.

If not, then you insert a bookmark on the last page of the document and use
a PageRef field to reference the page number of that bookmark instead of the
NumPages field.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Rhonda" <Rho...@discussions.microsoft.com> wrote in message
news:ACDEB1D8-3679-4886...@microsoft.com...

Jay Freedman

unread,
Apr 15, 2010, 11:20:33 AM4/15/10
to
There are two possible situations:

- If the document contains only two sections (separated by one section
break), then you can simply change the field that supplies the total. If you
right-click the total number and choose Toggle Field Codes, you'll see the
field code {NUMPAGES}. Change that to {SECTIONPAGES} and press F9 (or
right-click and choose Update Field) to show the result. This will now be
the total number of pages in the section that contains the body.

- If the body of the document consists of two or more sections (not counting
the frontmatter section), then the SECTIONPAGES field won't work -- it would
show the total of pages in the current section, which would change part way
through the body. Instead, first insert a bookmark in the last paragraph of
the document -- I suggest naming it LastPage. Now right-click the total
number in the page numbering and choose Toggle Field Codes. Replace the word
NUMPAGES with this:

PAGEREF LastPage

(If you named the bookmark something else, use that in the field code.)
Press F9 to update the field, which will show the page number of the last
page in the body.

There's a minor difficulty with this: It's easy to overwrite and delete the
bookmark, in which case the field will display "Error! Bookmark not
defined." Then you have to go back to the end of the document and insert the
bookmark again. It's also easy to add more pages after the bookmark, in
which case the page numbering will be wrong, and you'll have to move the
bookmark (which you do by going to the end of the document and inserting the
same bookmark, which automatically deletes the old one). It helps to go into
the Options dialog and check the box to display bookmarks at all times.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

virginiawilber

unread,
May 20, 2010, 3:51:20 PM5/20/10
to

I read your reply and I am unable to get it to work even though I didn't have a problem getting this to work in Word 2003.

I select Page Number from the Header/Footer portion of the toolbar and get:

Page 1 of 159

Then I use Alt F9 to see what it actually says and get:

Page { PAGE } of { NUMPAGES }

as you said (I'm using Word 2007). Then I change it to read:

Page { PAGE } of { = { NUMPAGES } - 3 } as specified -- inserting the "= {" and "} - 3" within the NUMPAGES original braces.

However, the results are not correct. Below is what I get when I use Alt F9 to return to "regular" view.

Page 1 of

So next I change it to read:

Page { PAGE } of { = { NUMPAGES } - 3 } as specified -- inserting the "{ = " and " - 3 }" outside the original NUMPAGES braces.

Again the results are not correct. Below is what I get when I use Alt F9 to return to "regular" view.

Page 1 of { = 159 - 3 }

I certainly hope you can help.

Suzanne S. Barnhill wrote:

If you know the number of pages in the front matter (and it will notchange),

15-Apr-10

If you know the number of pages in the front matter (and it will not
change), then you can use Page { Page } of { = { NumPages } - x }, where x
is the number of pages in the front matter.

If not, then you insert a bookmark on the last page of the document and use
a PageRef field to reference the page number of that bookmark instead of the
NumPages field.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

Previous Posts In This Thread:

On Thursday, April 15, 2010 10:07 AM
Rhonda wrote:

Total Page Number Minus Number of Pages in Front Matter


I have a document with 4 pages of front matter (cover page and table of
contents) and then 42 pages of text in the body of the document. I have the
pages of the body numbered "Page X of Y", but the Y is the total pages of the
entire document (46) and I want it to represent Y minus the pages in the
front matter (42) i.e. I want all my body pages to actually say "Page 'X 'of
42" not "Page 'X' of 46". Of course I could manually enter the number 42 in
place of Y, but the document will eventually be updated and additional pages
will result so I want it automated. (If the solution involves fields and
formulas, go slow I have no idea how to create new ones!)

Thanks so much!
Rhonda

On Thursday, April 15, 2010 11:02 AM
Suzanne S. Barnhill wrote:

If you know the number of pages in the front matter (and it will notchange),
If you know the number of pages in the front matter (and it will not
change), then you can use Page { Page } of { = { NumPages } - x }, where x
is the number of pages in the front matter.

If not, then you insert a bookmark on the last page of the document and use
a PageRef field to reference the page number of that bookmark instead of the
NumPages field.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

On Thursday, April 15, 2010 11:20 AM
Jay Freedman wrote:

There are two possible situations:- If the document contains only two sections
There are two possible situations:

- If the document contains only two sections (separated by one section
break), then you can simply change the field that supplies the total. If you

right-click the total number and choose Toggle Field Codes, you will see the


field code {NUMPAGES}. Change that to {SECTIONPAGES} and press F9 (or
right-click and choose Update Field) to show the result. This will now be
the total number of pages in the section that contains the body.

- If the body of the document consists of two or more sections (not counting

the frontmatter section), then the SECTIONPAGES field will not work -- it would


show the total of pages in the current section, which would change part way
through the body. Instead, first insert a bookmark in the last paragraph of
the document -- I suggest naming it LastPage. Now right-click the total
number in the page numbering and choose Toggle Field Codes. Replace the word
NUMPAGES with this:

PAGEREF LastPage

(If you named the bookmark something else, use that in the field code.)
Press F9 to update the field, which will show the page number of the last
page in the body.

There is a minor difficulty with this: it is easy to overwrite and delete the


bookmark, in which case the field will display "Error! Bookmark not
defined." Then you have to go back to the end of the document and insert the

bookmark again. it is also easy to add more pages after the bookmark, in
which case the page numbering will be wrong, and you will have to move the


bookmark (which you do by going to the end of the document and inserting the
same bookmark, which automatically deletes the old one). It helps to go into
the Options dialog and check the box to display bookmarks at all times.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Rhonda wrote:


Submitted via EggHeadCafe - Software Developer Portal of Choice
LINQ With Strings
http://www.eggheadcafe.com/tutorials/aspnet/03afdcf3-7b60-47db-adb9-db7fe2c6ab8c/linq-with-strings.aspx

Suzanne S. Barnhill

unread,
May 20, 2010, 4:22:56 PM5/20/10
to
Are you using Ctrl+F9 to insert the braces? The easiest way to do this is to
type = before the { NUMPAGES } field and -3 after it, then select the entire
expression and press Ctrl+F9.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

<Virginia Wilber> wrote in message
news:2010520155119vi...@lmco.com...

gabbypow...@gmail.com

unread,
May 15, 2014, 12:00:03 PM5/15/14
to
On Thursday, April 15, 2010 10:07:02 AM UTC-4, Rhonda wrote:
> I have a document with 4 pages of front matter (cover page and table of contents) and then 42 pages of text in the body of the document. I have the pages of the body numbered "Page X of Y", but the Y is the total pages of the entire document (46) and I want it to represent Y minus the pages in the front matter (42) i.e. I want all my body pages to actually say "Page 'X 'of 42" not "Page 'X' of 46". Of course I could manually enter the number 42 in place of Y, but the document will eventually be updated and additional pages will result so I want it automated. (If the solution involves fields and formulas, go slow I have no idea how to create new ones!)Thanks so much!Rhonda

YOU ARE A GENIUS. THE ANSWER TO MY X of Y was I wasn't using Ctrl+F9 to make brackets. Thank you.
Reply all
Reply to author
Forward
0 new messages