View Single Post
  #4   Report Post  
Jay Freedman
 
Posts: n/a
Default

BarbaraF wrote:
I am trying to set up a template for a document with several
sections, each section starting on "next page". I want the header of
the first page of each section to show e.g "introduction", "text",
etc, and all the subsequent pages in the section to show e.g.
"introduction (continued)". I can do this by clicking "different
first page" under page setup. I also want the footer to include the
page number on the left for even pages and on the right for odd pages
(outside edge when printed double sided). I can do this by clicking
"different odd and even". However this is no good if I tick both -
the problem arises because the first page of a new section may be
either odd or even, so I cannot sensibly define the first page
footer. If I define it to show the page number on the right, say,
then it comes on the right regardless of whether that section happens
to fall odd or even.

Can anyone help please!


Hi Barbara,

You can have your cake and eat it, too -- use both different odd/even and
different first page -- by constructing a pair of slightly complex fields in
the first-page footer.

On the left side of the footer, the field code should look like this:

{ IF { = MOD({PAGE},2) } = 0 "{PAGE}" "" }

This field displays the page number on even-numbered pages and displays
nothing on odd-numbered pages.

To build this up, start by inserting a {PAGE} field by clicking the # button
on the Header/Footer toolbar. (Press Alt+F9 so you can see field codes
instead of results, which makes this easier to follow.) Then type the =
MOD( before it and the ,2 after it to get

= MOD({PAGE},2)

That expression evaluates to 0 on even pages, and evaluates to 1 on odd
pages. Select all of the expression (but not the paragraph mark after it)
and press Ctrl+F9 to add the field braces around it.

Now type IF to the left of the field and = 0 "" "" to the right of the
field to get

IF { = MOD({PAGE},2) } = 0 "" ""

Put the cursor between the first pair of quotes and click the # button on
the toolbar again to insert another {PAGE} field. Finally, select the whole
thing (again avoiding the paragraph mark) and press Ctrl+F9 again.

Select the field and copy it to the clipboard. Type two tabs to get to the
right margin, and paste. Now use cut-and-paste to swap the positions of the
"{PAGE}" and the "" to make the second field look like this:

{ IF { = MOD({PAGE},2) } = 0 "" "{PAGE}" }

This field, the converse of the first one, displays the page number on
odd-numbered pages and displays nothing on even-numbered pages.

Finally, press Alt+F9, select the whole footer paragraph, and press F9. You
should be able to use Same As Previous to run this first-page footer through
all your sections.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org