TKB Regularly

Lunchtime learning - Excel

Return to lunchtime menu

Do make sure that any tips and suggestions work as you expect them to in your own particular circumstances.

Google

Automatic continued in Word

This was inspired by an excellent question from one of my clients working on a Word template for their letters, how could the word 'continued…' be included automatically on page one of each letter, but only if the letter was longer than a single page?

A more standard question is how to include space for the headers and footers of preprinted letterhead stationery on page 1 only. This can be done by ensuring that in the Layout section of File, Page Setup (Word 2007: Page Layout ribbon tab, Page Setup section, Dialog button), the 'Different first page' option is selected. This allows you to set up empty headers and footers on page one of the right size to allow for the letterhead but, because of the 'Different first page' option, they will not appear on subsequent pages.

The 'continued…' question is not so straightforward. The headers and footers for the letterhead are required on page one, whether there is one page or many pages, but as we have said, the 'continued…' should only be included when a second page is needed. After a fair amount of thought, the following solution came to mind. Set up the 'Different first page' option as before, and this time, in the appropriate position of the header or footer insert a Word 'IF' field. The IF should check whether the number of pages in the document is greater than 1 and if so, include 'continued…', and if not omit the word.

The Word field should look something like this:

Be very careful when entering the Word field - forgetting a space or getting the syntax wrong in any other way will probably stop it working properly.

If you are not very familiar with using Word fields, the best method of inserting an IF field is probably to use the Insert, Field (Word 2007: Insert ribbon tab, Text section, Quick Parts, Field) option in two stages.

First use Insert, Field to insert the IF field. Don't worry about calculating the number of pages at this stage, but instead just type in a placeholder - for example the word 'pages':

i.e.

IF pages > 1 “continued….” “”

The IF field compares two 'expressions' and then prints one item of text if the comparison is evaluated as 'true' or a different item of text if it is 'false'.

In fact, in this case because we don't need anything printed if the result is false we could omit the 'FalseText' altogether:

IF pages > 1 “continued….”

Then right click on the resulting field result, and choose Toggle Field Codes to show the underlying code. Double Click on the word 'pages' to select it, then go to Insert, Field again and this time use the field DocProperty, Pages:

Now select the entire field, right click, and choose Toggle Field Codes again to toggle back to displaying the result of the field.

Finally, to make sure the field result is recalculated every time the document is printed, set the 'Update field' option in the Tool, Options, Print screen (Word 2007: Office button, Word option button, Display, Printing Options section, Update fields before printing):

To deal with a question and answer that arose when this article was originally posted on our Beancounter's Guide blog, you could adapt this approach to include 'continued' on all pages apart from the last page. To do this, turn the 'Different first page' option in the Page Setup dialog off, then use the same method of inserting fields to insert the following IF field in the header or footer: 

This time we compare the current page number (PAGE) with the total number of pages (DOCPROPERTY Pages) and only if the current page number is less than the total number of pages (i.e. it's not the last page) do we print the 'continued...' wording.

Get lots more Microsoft Office hints and tips

 

 

© 1998 The Knowledge Base. Disclaimer   Contact info@tkb.co.uk
Design by Reading Room Ltd 1998