numpage field - Word 2007

J

jem_01354

I need to have the number of pages (minus 2) within a document. I've
discovered how to have it show as a word with an initial capital, which is
what I want, but I don't know how to deduct 2 from the total number of pages.
Is it possible to do that and, if so, please tell me how?

Many thanks.
 
S

Stefan Blom

You'll need the following field construct:

{ = { NUMPAGES } - 1 }

Since you have already inserted the NUMPAGES field, you could type in the
equal sign and - 1, select the whole construct and press Ctrl+F9 to add the
outer field delimiters, { }.

Alternatively, just type in the code, carefully pressing Ctrl+F9 to insert
each pair of field delimiters.

To update the selected fields, press F9. To show/hide field codes, use
Alt+F9.
 
G

Graham Mayor

Shouldn't that be { = { NUMPAGES } - 2 }? ;)

However the reference to showing the result as a word with initial caps
suggests a little more is required

{ IF { Numpages } > 1 "{ =({ Numpages } - 2) \*cardtext \*caps}" }

If the construction is use without the condition, a one page document would
produce a negative value which would error out when used with the cardtext
switch.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Stefan Blom

Of course, - 2 would be required!

As for the rest, I got the impression that the OP had already figured it
out?
 
M

macropod

Provided the document has at least two pages, you could use:

{={NUMPAGES}-2 \# "0;;" \* cardtext \* caps}

However, I'd be inclined to insert a 'Next Page' Section break between pages 2 & 3, unlink the Section 2 footer and use a 'page X of
Y' scheme based on starting the X page numbering at 1 on page 3 and basing the Y page numbering on a SECTIONPAGES field. This works
much better with TOCS, PAGEREF fields, etc.
 
J

jem_01354

Thanks, Stefan, that's brilliant, but I need a bit more help, please.
Originally I had it showing the number as Four (i.e. the word, with an
initial capital), which is what I want. The code for this showed as {
NUMPAGES \* CardText \* FirstCap \* MERGEFORMAT } but when I add the outer
field delimiters etc as you showed, I get an error message saying !Undefined
Bookmark, FOUR. If I take out the CardText and FirstCap switches, it works
perfectly but shows the number as a number. Your further assistance would be
greatly appreciated.

Many thanks.
 
J

jem_01354

Stefan, Graham and macropod, many thanks for your responses. I didn't see
them before I posted my reply to Stefan. I suspect the answer to my problem
is somewhere within your replies and I'll let you know how I get on.

Many thanks.
 
S

Stefan Blom

Go with macropod's suggestion if you want to create automatic tables of
contents or cross-references (that show the correct numbers); if you don't
need that, make use of Graham's field construct. :)
 
J

jem_01354

Brilliant, thank you all! I used this code: {={NUMPAGES}-2 \#"0;;"
\*CardText \*FirstCap} and it does exactly what I wanted. Many thanks!!
 

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

Top