PDA

View Full Version : Pagecount of 2 sections



wpanssi
10-25-2008, 03:17 AM
Let's assume I have three sections A, B and C in my word document. The A section contains the cover page and the index and I don't want to include them to the total number of pages of the document.

I want to present the number of pages in B + the number pf pages in C as the total number of pages in the document. However, I don't know how I can present the sum of pages of two sections in the header. The Field numpages contains all the pages including section A while sectionPages contains just the pagecount of one section.

I was wondering could I somehow use the formula field to count the pages in sections B and C? And with this I need help.. Is this possible? Or do I need macros? How can I do it with macros?

Thanks!

fumei
10-27-2008, 09:17 AM
If Section A has two pages (and it is not going to change), then yes you can use the formula field. You must use Ctrl-F9 to insert the field brackets - the { } - as typing the characters (the brackets) does NOT work.

It should end up looking like this.

{{=SUM({NUMPAGES \* MERGEFORMAT}, -2) }}

In the header:

1. Press Ctrl-F9
2. Insert > Field... > Formula and select SUM from the Paste Function, and OK. It should look like:

{{ SUM() }}

3. Move the cursor between the SUM brackets ()

4. Insert > Field... > NumPages. It should now look like:
{{ SUM({NUMPAGES \* MERGEFORMAT}) }}

5. Now add a comma and a -2
{{=SUM({NUMPAGES \* MERGEFORMAT}, -2) }}

Make sure you have the comma and -2 INSIDE the SUM brackets, but outside the field brackets for NUMPAGES.

So, basically the formula takes NUMPAGES (all the pages) and subtracts 2 (the pages in Section A).

fumei
10-27-2008, 09:30 AM
Aaaccckkkkk!!!!

My apologies. I am wrong. Do NOT start with Ctrl-F9!

Wrong wrong wrong. My brain was leaking. Skip my #1!

It should look like:

{=SUM({NUMPAGES \* MERGEFORMAT}, -2) }

Not:

{{=SUM({NUMPAGES \* MERGEFORMAT}, -2) }}

I need a coffee.

macropod
10-28-2008, 03:25 AM
Hi wpanssi,

Here's another way:
. In Section 1's header or footer, insert a field coded as
{SET Scn1 {SECTIONPAGES}}
. In Sections 2 & 3, for your pagecount field, insert a field coded as
{={NUMPAGES}-Scn1}This has the advantage of making the page count independent of any changes to the page count in Section 1.

fumei
10-28-2008, 11:10 AM
Nice. I figured macropod would come up with a better way. He is the Word Field guru.