Apr 27, 2011

Custom page numbering in MS Word

I'm sure most of you came across this problem before - how to add custom page numbering.

I don't really like making seperate documents for the pages I don't want numbered and options in MS Word are preety limited. You can set up the numbering to start with a different number. You can't, however, set it up to start with a negative number.

Example: You have the first three pages you don't want numbered (front page, page index, thanks). Everything after those pages is numbered and starts with 1.

- Go to the header/footer - wherever you want to set up page numbering.
- Add page numbering, set it up to start with zero and check the option to have a different header/footer on the first page. This way the front page will have the page number zero, but you can delete numbering for that page.
- Now you need to "extend" the first page, so that the second (or third) page will also be unnumbered. You can do this with page breaks, go to Insert -> page break. There are a couple of different page breaks, choose the one that fits your needs.

There's an other way to do a completely custom page numbering, but it involves a tiny amount of "programming" and it won't work the same if you add page index, but here goes:

- Go to the header/footer
- Retype this code for the example above:
{ IF { PAGE } < 4 "" "{ = { PAGE } - 3 }" }


The important thing here is that you need to press CTRL+F9 to get the curly braces. If you retype them, it won't work.
- After you've written the conditions for page numbering, right-click on it and choose "Update field".

{ IF { PAGE } < 4 "" "{ = { PAGE } - 3 }" }
This is a simple conditional statement, if the current page number is less than four, the first argument (The empty "" string) will be used, otherwise it will calculate the current page number minus three.

Here are some other examples:
{ IF { PAGE } < 3 "" "{ = { PAGE } - 2 }" }
Skip the first two pages

{ IF { PAGE } < 3 "{ PAGE }" "{ = { PAGE } + 5 }" }
Number the first two pages normally, then add 5 to the current page number.

{ IF { PAGE } < 3 "{ PAGE }" "" }
Add a page number only to the first two pages.

Source

5 comments:

Anonymous said...

I need a pagination that looks like this, and can't find it in Word:

Page 1 of X
Page 2 of X

and so forth.

Can you tell me how to do this?

jeancaffou said...

For the page number you can use the methods described in the article. The "Page" and "of" is just a normal string you can write in the header/footer before the page number code/macro. Total number of pages is also a macro, which you can get and insert in the header/footer from the MS Word toolbar, when you're editing the header/footer.

Unknown said...

I'm using the following conditional statement that will print 'saad' ONLY on last page. This statement works perfect and as desired if placed anywhere in document but not inside the footer. But i want to get this working inside footer. Any idea what can be the issue? And its workaround?

{ If { { PAGE } } = { { NUMPAGES } }"saad" "not last page" }

Reply me here or on email at saadumair@gmail.com

Any help would be appreciated.

Trouble Shooter said...

I have no idea why it would work anywhere but the footer. The only thing that comes to mind is that the code can't be copy/pasted.
From the article: "The important thing here is that you need to press CTRL+F9 to get the curly braces. If you retype them, it won't work."

Anonymous said...

This was GREAT Information. Saved me considerable amount of Time and Energy.