Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

numpage field - Word 2007

54 views
Skip to first unread message

jem_01354

unread,
Feb 10, 2010, 5:06:01 AM2/10/10
to
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.

Stefan Blom

unread,
Feb 10, 2010, 5:15:27 AM2/10/10
to
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.

--
Stefan Blom
Microsoft Word MVP

"jem_01354" <jem0...@discussions.microsoft.com> wrote in message
news:55F22563-E0F2-41A8...@microsoft.com...

Graham Mayor

unread,
Feb 10, 2010, 5:47:33 AM2/10/10
to
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
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


"Stefan Blom" <Stefa...@discussions.microsoft.com> wrote in message
news:%23VedEmj...@TK2MSFTNGP04.phx.gbl...

Stefan Blom

unread,
Feb 10, 2010, 5:59:34 AM2/10/10
to
Of course, - 2 would be required!

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

--
Stefan Blom
Microsoft Word MVP

"Graham Mayor" <gma...@REMOVETHISmvps.org> wrote in message
news:ee%23qt5jq...@TK2MSFTNGP04.phx.gbl...

macropod

unread,
Feb 10, 2010, 6:12:26 AM2/10/10
to
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.


--
Cheers
macropod
[Microsoft MVP - Word]


"Graham Mayor" <gma...@REMOVETHISmvps.org> wrote in message news:ee%23qt5jq...@TK2MSFTNGP04.phx.gbl...

jem_01354

unread,
Feb 10, 2010, 8:09:03 AM2/10/10
to

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.

"Stefan Blom" wrote:

> .
>

jem_01354

unread,
Feb 10, 2010, 8:37:01 AM2/10/10
to
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.

Stefan Blom

unread,
Feb 10, 2010, 8:45:10 AM2/10/10
to
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. :-)

--
Stefan Blom
Microsoft Word MVP

"jem_01354" <jem0...@discussions.microsoft.com> wrote in message

news:C5742457-8E57-413E...@microsoft.com...

jem_01354

unread,
Feb 10, 2010, 8:58:01 AM2/10/10
to
Brilliant, thank you all! I used this code: {={NUMPAGES}-2 \#"0;;"
\*CardText \*FirstCap} and it does exactly what I wanted. Many thanks!!
0 new messages