controlling the number of the last page

  • Thread starter Thread starter Pamela Denchfield
  • Start date Start date
P

Pamela Denchfield

Apparently I can change the number of the first page in a section, but the
last page retains its original identifier. For example, the second section of
my eight-page template is set to restart page numbering at 1, which is does
successfully. However, my footer "Page X of Y" says "Page 1 of 8" when it
should say "Page 1 of 4." The last page should be 4, not 8.

Any ideas? I'm on Word 2007 (XP machine).
 
In the standard "Page X of Y", the X and Y are fields. The X is a
{Page} field that shows the current page number. The Y is a {NumPages}
field, which shows _how many_ pages are in the document, not the page
number of the last page.

To get what you want, you need a little subterfuge. Put a bookmark on
the last page; let's say you name it LastPage. Then replace the
{NumPages} field in the footer with a {PageRef LastPage} field -- you
can go through Insert > Quick Parts > Field, or you can simply
right-click the existing field, choose Toggle Field Code, and edit the
field code, then press F9 to update it. Just be careful not to delete
the bookmark if you edit at the end of the document.
 
I appreciate the reply. Would this approach work for widely distributed
templates? I'm concerned that others might inadvertently delete the required
bookmark from the last page.
 
The setup will work, but it is fragile because there's no way to prevent the
deletion of a bookmark. There are two ways to handle this:

- The simpler one is to tell users that if the footer says something like
"Page 2 of Error! Bookmark not defined." then they need to re-insert the
bookmark and update the fields.

- The more complex one -- and thus more prone to glitches -- is to write
macros that intercept the user's commands to save, print, or send the
document and, if the bookmark doesn't exist, recreate it before continuing
with the command. Because there are a number of variations of each command,
this gets to be tedious and error-prone. In addition, if the user's security
level is set too high, the macros will be disabled unless you've applied a
digital signature to them, and that involves paying real money for a
certificate.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top