Wednesday 26 November 2014

Word- No footers on the last page

You don't always want to have exactly the same set of headers and footers all the way through a document. While you can change your headers and footers at any point in your document by inserting section breaks it is not always the perfect solution.

For example, many legal documents like Wills or Witness Statements require that each page should be individually signed at the foot of the page but then, on the last page of the document, is a more general declaration that is signed and dated and here the signature footer is not required. This general declaration is not on a separate page, it follows on from the last paragraph.

In this article we are going to demonstrate creating a lawyer's Witness Statement using Word field codes to control whether footers should be displayed or not by testing for the last page and also how to enter the Witness' name once and then have it copied wherever else it is required in the body of the document. The same methods can be usefully employed on many other different types of commercial document such as contracts or service agreements.

Copying the Witness name

We want to type-in the witness’ name at the top of the document and then have it copied into the footers and at various locations in the rest of the main document automatically without our having to repeatedly copy and paste it. Our method is to create a Bookmark and then insert a REF field code which refers back to the bookmark wherever the witness’ name is required. When you change the text in the bookmark you just update all your REF fields and the new text is copied in one go.

The Witness name is entered at the start of the document

The placeholder text (“Jehovah”) for the bookmark is at the top of the document, select it and then click Bookmark on the Links group of the Insert tab. Enter a suitable name (my one's called “Witness”) and click the Add button. You only have to do this once.


Bookmark brackets

When you replace the placeholder text it’s really easy to overtype the original bookmark and destroy it so it’s a good idea to turn on your bookmark brackets so you can see what you’re doing. For this, click File, Options, Advanced, then down to Show document content and tick the checkbox for Show bookmarks

Your bookmark is now enclosed in [grey square brackets]. Stay strictly inside the brackets when changing the text. To be on the safe side, I always overtype the new text from the second character and then backspace out the first character at the end. Bookmark brackets are not printed.

Inserting a REF field code

You should now insert a REF field code wherever you need to have your bookmark text copied. Click Insert tab, Text group, the Quick Parts control and then choose Field from the drop-down menu. Scroll down the list on the left, click REF and then choose your bookmark name from the Field properties list on the right. Click OK and your bookmark text should appear.

Inserting Field Codes
To see the field code, select it and press SHIFT+F9:

{ REF Witness \* MERGEFORMAT }

The \* MERGEFORMAT switch element just preserves the formatting of the field when it is updated and if that is not important to you then you can either remove it from the field code or make sure that the Preserve formatting during updates checkbox is not ticked when the code is entered. Certainly removing this switch makes your field code much easier to read and interpret, like this:

{ REF Witness }

Press SHIFT+F9 again to hide the code and then check that it’s all working. Change the bookmark text, select your field code and then press F9 to update it. When you want to update all the fields in the document press CTRL+A to select all the text and then F9 to update all fields. Your {REF Witness} code, like all field codes, has a grey background when it is active which I shall not show for the rest of this article.

No Footers on the Last Page

We need the Witness’ name and signature in the footer of every page other than the last one. On the last page there is a general declaration which is signed and dated and therefore we don't want to see the signed footer on this page. Apologies if you are a Jehovah's Witness, take pity on my pathetic sense of humour.

Signature line and Witness name appear in the footer of every page
Having a section break before the last page and then changing the footer for that section is a no good for us as it will force the signed declaration at the end of the document onto a new page whereas we need it to follow on after the last paragraph.

Except for the last page where only the page number appears

Creating Conditional Footers

The footers on each page are generated with an IF field code that uses the conditional logic, “If this page is not the last page then show the footer”. There’s one for the name and there’s one for the signature line as follows:

{IF {PAGE}<>{NUMPAGES} Signature___________}
{IF {PAGE}<>{NUMPAGES} {REF Witness}}

The PAGE field returns the current page number and the NUMPAGES field the total number of pages in the document. Therefore the expression "{PAGE}<>{NUMPAGES}" means "the number of this page is not equal to the number of the last page".

The process is as follows:

  1. Edit your footer.
  2. Insert the field codes.

To edit your footer click the Insert tab, Footer control and then Edit Footer. Now, press ALT+F9 to view your field codes so that you can see what you're doing.

Then click the Insert tab, Text group, the Quick Parts control and then choose Field from the drop-down menu. Scroll down the list on the left and click IF in the listing, make sure that Preserve formatting during updates checkbox is not ticked and click OK to start off your conditional field code which should be like this:

{IF } 

Again, the field code has a grey background when it's active. To continue with the rest of the field, click inside the brackets and leaving a space after the IF field insert a PAGE field, then type-in “<>” (the logical operator for "is not equal to") and then insert a NUMPAGES field. That’s the conditional test, “If the number of this page is not equal to the number of the last page?” or, in plain English, “If this is not the last page?” 

{IF {PAGE}<>{NUMPAGES}} 

The logical outcome of the test is to show the text “Signature__________” Leave a space after the NUMPAGES field and type in the text inside the closing } bracket. 

{IF {PAGE}<>{NUMPAGES} Signature___________} 

Press enter to go the next row in the footer and repeat the process for the second IF field code. In this case the logical outcome is to show the witness’ name which is done by inserting a REF field. Always try to insert your field codes using the list, don’t just type them in.

{IF {PAGE}<>{NUMPAGES} {REF Witness}}

Showing and hiding Field Codes

You don't usually need to see all the field codes in your document but you need to see them when you're working on them. Otherwise, you just let them get them get on with things. Press ALT+F9 to see all the field codes or SHIFT+F9 to see the currently selected code. Press the same shortcut keys again to hide the field codes.

Viewing the Field Codes in the page footer

Updating Field Codes 

To update all the fields in the body of your document, press CTRL+A to select and then press F9 to update. Word is divided into separate text flows or stories and your body text and your headers and footers are separate stories. CTRL+A and F9 updates all of your main story but it does not update your headers and footers story.

To update all the fields in your footers, either edit the footer and then press CTRL+A and F9 again or (far easier!) just press CTRL+F2 which switches to Print Preview and automatically updates your field codes. Then exit the preview as you usually do.

Related Posts