wordsite.com

   
 


Frequently Asked Questions about Word

Documents and templates

Headers and footers and page numbers

Find-and-replace

A few words about Word's draw layer

Working with graphics

Printing

Customizing Word

Unexpected behavior

Miscellaneous How-To . . .

How Word Differs from WordPerfect

Microsoft is a registered trademark of Microsoft Corporation
 
 

   


Headers and footers and page numbers

Click a topic:

Control the page numbering in a Word document.

Treat different pages differently with the help of an "if" field

Insert the filename and path on the last page of a document, in a form that will be updated automatically if the filename or path changes.

Display the word "more" at the bottom of every page except the last page.

Make footers appear differently on the first page of a news release compared with all subsequent pages, without using section breaks.

Display page numbers as cardinal text (one, two, three, etc.).

Set up a one-page template so that, when it expands to two or more pages, the new pages will have different headers and footers than the first page.

Automatically include in the header of a document a copy of the text from the current Heading 1 paragraph.

Display page numbers in the Page X of Y format when the first page of the document is an unnumbered title page.

Show nothing on pages 1 and 2, then show page 1 on page 3, page 2 on page 4, etc.

Display a page number that is greater by one than the actual page number (on every page except the last page).

In a document divided into sections, display the section number, or a derivative of it, in the footer of a document.

Prevent a user from opening the headers and footers for editing.

Control the page numbering in a Word document. <Top of Page>

Word's page numbering scheme isn't directly obvious but it isn't needlessly complex, either. Indirect might be a good term for it. Once you understand how it works, all sorts of possibilities open up. Unfortunately, the built-in tools that simplify the insertion of page numbers also happen to make it more difficult to tell what's really going on. So, for the moment, forget everything you've learned or think you know about page numbers. Let's start at the beginning, since it won't take too long . . .

First some background, consisting of four big ideas:
BIG IDEA #1: A new blank document consists of a single section. Each time you insert a section break into the document, the document gains a section.

In other words, if you create a new blank document, then choose Break on the Insert menu and select a Next Page section break, the document will thereafter consist of two sections: Material from the start of the document up through and including the break represents Section 1. Material after that represents Section 2. (In some cases, Word inserts section breaks automatically, such as when you change the number of columns in part of a document.)

BIG IDEA #2: Page numbers are a section property, not a document property. A page's number is determined by only two factors:
1. The "start at" value assigned to the document section.
2. The location of the page within its document section.

In other words, if a document section has been told to "start at" page 5, the first page of that section will be page 5, the second page will be page 6, the third page will be page 7, and so on.

BIG IDEA #3: Just because a page has a number doesn't mean the number will appear somewhere on the page. Far from it. In fact, ALL pages have numbers. The number never appears unless you tell Word to display it.

BIG IDEA #4: The easiest way to tell Word to display a page's number somewhere on the page is to insert a field code as follows:
1. Position the cursor where you want the number to appear. (Often, this is the header or footer. To position the cursor in one of these locations, choose Header and Footer on the View menu or double-click the location in Page Layout view.)
2. Press Ctrl+F9 to insert a pair of field braces: { }. (Don't just type them. You must use Ctrl+F9.)
3. Between the field braces, type "PAGE" without the quotation marks. (This will look as follows: { PAGE })
4. To control the numeric format of the number, add a "switch" by continuing to type until your field code looks like one of the following:
{ PAGE \* Arabic }
{ PAGE \* alphabetic }
{ PAGE \* ALPHABETIC }
{ PAGE \* roman }
{ PAGE \* ROMAN }
5. Right-click anywhere between the braces and choose Toggle Field Codes.

The "PAGE" field code is as uncomplicated as it looks. It has no effect on Word's page numbering scheme. It simply tells Word to display the number of the current page at the field location. As noted above, the page's number is dependent on:
1. The "start at" value assigned to the document section.
2. The location of the page within its document section.

This raises a question: How can you get your hands on the all-important "start at" value? After all, what good does it do to insert a PAGE field only to find out that Word thinks the second page of your document is page 102 because the "start at" value has been set to 101?

To change the start at value, proceed as follows, strange as it may seem to do so:
1. Position the cursor in the section of the document whose start at value you want to change.
2. Choose Page Numbers... on the Insert menu.
3. Choose Format...
4. Click Start At and enter the desired value.
5. Click OK to close the Format... dialog.
6. Click CLOSE to close the Page Numbers dialog. (Don't click OK or you'll insert a new {PAGE} field!)

The following big ideas are presented for extra credit only. Please see me after class if you're worried about your grades.

BIG IDEA #5: If a document is divided into multiple sections, the headers and footers for each section start out with their "same as previous" property turned on. This feature lets you insert a { PAGE } field into the header or footer for Section 1 and automatically have it appear in the headers or footers for all other document sections. (If you want to make changes to the header or footer for Section 1 without having those changes show up in the header or footer for all other document sections, you must turn off this feature by viewing each header and footer and clicking the Same As Previous button on the Header and Footer toolbar until the button is no longer depressed.)

BIG IDEA #6: Each section of a document can have up to three headers and footers: the first page header and footer, odd page headers and footers, and even page (aka "primary") headers and footers. The actual number of headers and footers available in a given section is determined by the Different First Page checkbox and Different Odd and Even Pages checkbox in the Page Setup dialog. To view these settings, position the cursor in the document section you're interested in, then choose Page Setup on the File menu. Changes made to the first page header have no effect on the odd page header or the even page header and vice versa all the way around.

BIG IDEA#7: Now that you know about { page } fields, you're just two steps away from some truly amazing possibilities, made possible by two other fields, the formula ( = ) field, and the If field. Consider: Want to force Word to display a number that's one higher than the real page number? Try using the following field, where braces are inserted using Ctrl+F9:
{ = { PAGE } + 1 }

Want to tell Word to display a page number on pages one, two, and three, but not on any other pages? Try using the following field, where braces are inserted using Ctrl+F9:
{ IF { PAGE } < 4 "{ PAGE }" "" }

Want to tell Word to put the "real" page number on pages one, two, and three, but a higher-by-one page number on all other pages? Try using the following field, where braces are inserted using Ctrl+F9:
{ IF { PAGE } < 4 "{ PAGE }" "{ = { PAGE } + 1 }" }

Treat different pages differently with the help of an "if" field. <Top of Page>

In its most basic form, Word's standard "IF" field looks like this:
{ IF "Expression" = "Expression" "Expressions Are Equal" "Expressions Are NOT Equal" }

This field evaluates the statement at the start of the expression ("Expression" = "Expression"). If the statement is true, the field inserts the first string of characters ("Expressions Are Equal") into the document. If the statement is false, the field tells Word to insert the second string of characters ("Expressions Are NOT Equal") into the document.

The field becomes more userful when it compares some meaningful values such as the current page number and the total number of pages in the document:
{ IF { PAGE } = { NUMPAGES } "Expressions Are Equal" "Expressions Are NOT Equal" }

The field becomes even more useful when it inserts a more descriptive string of characters into the document:
{ IF { PAGE } = { NUMPAGES } "This is the last page" "This is NOT the last page" }

The field becomes still more useful when it inserts a more valuable string of characters into the document:
{ IF { PAGE } = { NUMPAGES } { FILENAME } "This is NOT the last page" }

The field can choose a legitimate string ({FILENAME}) if the statement is true and a NULL string if the statement is false:
{ IF { PAGE } = { NUMPAGES } { FILENAME } "" }

The {FILENAME} field within the {IF ...} field can be upgraded to return to the path along with the filename:
{ IF { PAGE } = { NUMPAGES } { FILENAME \P} "" }

When a field is updated, any formatting applied to the field result may be lost. To prevent this, you can include a MERGEFORMAT switch:
{ IF { PAGE } = { NUMPAGES } { FILENAME \P \* MERGEFORMAT} "" }

Here's an If field that inserts roman page numbers in Section 1 and arabic page numbers in all other sections:
{ If { SECTION } = 1 "{ PAGE \* roman } of { SECTIONPAGES \* Roman }"XXXX"{ PAGE \* arabic } of { SECTIONPAGES \* arabic }"

Here's one that displays the page number only if the page number is greater than 4.
{ IF { PAGE } > 4 { PAGE } }

To insert an {IF ... } field into a document:
1. Press Ctrl+F9 to insert a set of field braces.
2. Inside the braces, type the expression shown below, using arrow keys to navigate within the field and Ctrl+F9 to insert additional braces as needed:
{ IF { PAGE } = { NUMPAGES } { FILENAME \P \* MERGEFORMAT} }
3. Select the entire field expression, starting with the first opening brace and ending with the last closing brace.
4. Right-click the selected area and choose Toggle Field Codes. This will tell Word to hide the field from view.
5. On the View menu, choose Header and Footer to close the header and footer view and return the cursor to the main document.

Tell Word to update the field with the current results:
1. To tell Word to update the field just before printing, click Options on the Tools menu, then choose the Print tab at the top of the dialog box and place a checkmark in the Update Fields checkbox.
2. To tell Word to update the field immediately, right-click the field and select Update Field.

For more information about fields:
Choose Field on the Insert menu. Then click the What's This? Button and choose a field code. Word will display a definition of the field with examples of how the code can be used.

Insert the filename and path on the last page of a document, in a form that will be updated automatically if the filename or path changes. <Top of Page>

Solution:
Insert into the header or footer an "if" field (special hidden instruction) that tells Word to insert the filename and path if on the last page but insert nothing if NOT on the last page.

Notes:
Inserting the field into the header or footer will assure that it will be present on the last page (and indeed all other pagges), no matter how many pages the document contains. Even though present on all pages, it will cause the filename and path to appear only on the last page.

The field in this case will be a compound entity that consists of three fields nested within a fourth field. It will look approximately like this:
{ IF { PAGE } = { NUMPAGES } { FILENAME \P \* MERGEFORMAT} }
The braces shown here were typed manually. The braces in the actual field will look slightly different, because Word will insert them using special characters that look slightly different.

Insert the required field into your doc:
1. On the View menu, choose Page Layout.
2. On the View menu, choose Header and Footer
3. Scroll up or down (if needed) until you can see the header or footer where you want the page number to appear.
4. Click where you want the page number to appear (could be at the beginning of a line, or just after a tab character, etc. etc.)
5. Press Ctrl+F9 to insert a set of field braces.
6. Inside the braces, type the expression shown below, using arrow keys to navigate within the field and Ctrl+F9 to insert additional braces as needed:
{ IF { PAGE } = { NUMPAGES } { FILENAME \P \* MERGEFORMAT} }
7. Select the entire field expression, starting with the first opening brace and ending with the last closing brace.
8. Right-click the selected area and choose Toggle Field Codes. This will tell Word to hide the field from view.
9. On the View menu, choose Header and Footer to close the header and footer view and return the cursor to the main document.

Tell Word to update the field with the current results:
1. To tell Word to update the field just before printing, click Options on the Tools menu, then choose the Print tab at the top of the dialog box and place a checkmark in the Update Fields checkbox.

2. To tell Word to update the field immediately, view the header or footer, then right-click the field and select Update Field. (Make sure you're on the last page of your document when you do this, or there'll be nothing to see after the field is updated!)

For more information about fields:
Choose Field on the Insert menu. Then click the What's This? Button and choose a field code. Word will display a definition of the field with examples of how the code can be used.

Display the word "more" at the bottom of every page except the last page. <Top of Page>

Solution:
Insert into the footer an "if" field (special hidden instruction) that tells Word to insert nothing on the last page and "more" on all other pages.

Notes:
Inserting the field into the footer will assure that it will be present on all pages, no matter how many pages the document contains. Even though present on all pages, it will not cause "more" to appear on the last page.

The field in this case will be a compound entity that consists of two fields nested within a third field. It will look approximately like this:
{ IF { PAGE } = { NUMPAGES } "" "more" }
The braces shown here were typed manually. The braces in the actual field will look slightly different, because Word will insert them using special characters that look slightly different.

Insert the required field into your doc:
1. Position cursor where you want the field.
2. Press Ctrl+F9 to insert the field braces. (Don't use regular braces!)
3. Type the field expression as it appears below, using Ctrl+F9 and arrow keys as needed to keep text within the various braces as you type.
{ IF { PAGE } = { NUMPAGES } "" "more" }
4. Select the entire expression.
5. Right-click the selection and choose Toggle Field Codes.

Tell Word to update the field with the current results:
1. To tell Word to update the field just before printing, click Options on the Tools menu, then choose the Print tab at the top of the dialog box and place a checkmark in the Update Fields checkbox.
2. To tell Word to update the field immediately, view the header or footer, then right-click the field and select Update Field.

For more information about fields:
Choose Field on the Insert menu. Then click the What's This? Button and choose a field code. Word will display a definition of the field with examples of how the code can be used.

Make footers appear differently on the first page of a news release compared with all subsequent pages, without using section breaks. <Top of Page>

Solution #1:
Go to File|Page Setup|Layout| and check Different First Page. This will establish separate header/footers for the first page and for all subsequent pages. Thereafter, while visiting page 1, you can view the first page header/footer and set its contents without affecting the header/footer for subsequent pages. Likewise, while visiting pages 2, 3, 4, etc., you can view the header/footer for those pages and set its contents without affecting the header/footer for page 1.

After implementing this solution, you can shorten your document to a single page without losing the headers/footers for subsequent pages. When the doc expands again to two or more pages, your headers will be as you set them. (In the future, you'll discover that you can start a new doc, set up the headers/footers that you're going to want for page 2, THEN check Different First Page and set up the headers/footers for page 1, without ever having to expand the document to more than one page.)

Solution #2:
Leave Different First Page UNCHECKED and insert an "if" field into the footer that will vary the footer according to the page number. Use the if field to insert special text in the first page footer but a page number in the footer of all other pages.

Notes:
Inserting the field into the header or footer will assure that it will be present on the first page and indeed all other pages, no matter how many pages the document contains. Even though present on all pages, it will behave differently on the first page as compared to all other pages.

The field in this case will be a compound entity that consists of two fields nested within a third field. It will look approximately like this:
{If { Page } = 1 "Special Text For First Page Goes Here!" "{ Page }" }
The braces shown here were typed manually. The braces in the actual field will look slightly different, because Word will insert them using special characters that look slightly different.

Insert the required field into your doc:
1. View Header/Footer
2. Position cursor where you want the field.
3. Press Ctrl+F9 to insert the first set of field braces.
4. Using arrow keys and Ctrl+F9 as needed, enter additional braces and text until your field looks as follows.
{If { Page } = 1 "Special Text For First Page Goes Here!" "{ Page }" }
5. Select the entire expression.
6. Right-click the selection and choose Toggle Field Codes.
7. Right-click the selection and choose Update Field.
8. On the View menu, choose Header and Footer to close the header and footer view and return the cursor to the main document.

Tell Word to update the field with the current results:
1. To tell Word to update the field just before printing, click Options on the Tools menu, then choose the Print tab at the top of the dialog box and place a checkmark in the Update Fields checkbox.
2. To tell Word to update the field immediately, view the header or footer, then right-click the field and select Update Field. (Make sure you're on the last page of your document when you do this, or there'll be nothing to see after the field is updated!)

For more information about fields:
Choose Field on the Insert menu. Then click the What's This? Button and choose a field code. Word will display a definition of the field with examples of how the code can be used.

Display page numbers as cardinal text (one, two, three, etc.). <Top of Page>

Solution:
1. Right-click the existing page number and choose Toggle Field Codes.
2. Edit the field code to look as follows:
{ PAGE \* CardText \* Caps \* MERGEFORMAT }
3. Right-click the existing page number and choose Toggle Field Codes.

Set up a one-page template so that, when it expands to two or more pages, the new pages will have different headers and footers than the first page. <Top of Page>

Solution:
1. Open template and view the header and footer.
2. Put material into the header and footer. Make sure this is the material that you want to appear on pages 2 through X.
3. Click the Page Setup tool on the Headers and Footers toolbar, then click the Layout tab and select Different First Page and click OK.
4. Put in the material you want to appear on page one.
5. Save and close the template.
From now on, when documents based on this template grow to two or more pages, the header and footer on pages 2-X will display the material you entered in Step 2.

Automatically include in the header of a document a copy of the text from the current Heading 1 paragraph. <Top of Page>

Solution:
Insert into the header or footer a "Style Reference" field (special hidden instruction) that tells Word to locate the current Heading 1 paragraph and copy its text into the header at the field location.

Notes:
Fields are special instructions that tell Word to insert text into your document. If you place a field into your header, it will tell Word to insert some text into your header.

You can use a "style reference" field to insert the text you're interested in. The style reference field searches for the first occurrence of text of a given style and uses that text wherever you place your field.

To insert a style reference field for the heading 1 style:
1. Position the cursor in the header, where you want the field to be located.
2. Choose Field on the Insert menu.
3. In the categories list, select ALL.
4. Scroll down the fields list and select StyleRef
5. Click the Options button, then click the Styles tab at the top of the Options panel.
6. Select Heading 1, then click Add to Field and click OK twice.

After the field is inserted, you can look at the hidden codes by right-clicking the field and selecting Toggle Field Codes. This should reveal the following code:
{ STYLEREF "Heading 1" \* MERGEFORMAT }

To hide the code, right-click and select Toggle Field Codes again. To "update" the field, which is to say, tell Word to get the current value for the field, right-click the field and select Update Field.

For more information:
1. Choose Field on the Insert menu.
2. In the categories list, select ALL.
3. Scroll down the fields list and select StyleRef
4. Click the What's This (?) button at the top of the dialog box, then click the StyleRef selection.

Display page numbers in the Page X of Y format when the first page of the document is an unnumbered title page. <Top of Page>

Solution:
1. Go into your footer and select the entire page numbering string (page x of y) and right-click it and select Toggle Field Codes. This will reveal an expression that looks as follows:
Page { PAGE } of { NUMPAGES }

2. Change this expression to read as follows:
Page { PAGE } of { SECTIONPAGES }

3. Select this entire expression and right-click it and select Toggle Field codes again. Then right-click it a second time and select Update Fields.

That way, the y in page x of y will represent the number of pages in the second section of your document. (I'm assuming that you've used a section break between the cover page and the rest of the document.) The only possible problem with this approach is that the sectionpages value may not update itself automatically at print time. I never use page x of y, so I don't have personal experience with this. But if this is indeed a problem, it seems to me the recommended solution is to turn off background printing (Tools|Options|Print) and to go to print preview twice (yes twice!) before printing.

Another approach uses the following expression:
Page { PAGE } of { = { NUMPAGES } - 1 }

To create this expression:
1. Select and delete the original { NUMPAGES } expression.
2. Press Ctrl+F9 to insert a new set of braces { }. (Don't just type the braces. You must use Ctrl+F9)
3. Type an = sign, then press Ctrl+F9 a second time. { = }
4. Press Ctrl + F9 again. { = { } }
5. Enter NUMPAGES. { = { NUMPAGES } }
6. Use the arrow keys to move the cursor between the two closing braces and type - 1. { = { NUMPAGES } - 1 }
7. Select this entire expression and right-click it and select Toggle Field codes again. Then right-click it a second time and select Update Fields.

Show nothing on pages 1 and 2, then show page 1 on page 3, page 2 on page 4, etc. <Top of Page>

Solution:
Insert the following field into the document header or document footer:
{IF { PAGE } > 2 { = {PAGE } - 2 } }

Notes:
Fields are made up of special brackets, which you can insert by pressing Ctrl+F9, plus text that you can enter as you would any other text.

To create the field shown above:
1. Position your cursor in the header or footer of your document.
2. Press Ctrl+F9 to insert the first set of brackets { }
NOTE: Don't try to use regular brackets. You must use Ctrl+F9 brackets!
3. Type "IF " between the brackets { IF }
4. Press Ctrl+F9 to insert the second set of brackets { IF { } }
5. Type "PAGE " between the new brackets { IF { PAGE } }
6. Press Right Arrow to move outside the second set of brackets.
7. Type "> 2 " { IF { PAGE } > 2 }
8. Press Ctrl+F9 to insert the third set of brackets {IF { PAGE } > 2 { } }
9. Type "= " {IF { PAGE } > 2 { = } }
10 You get the idea. Keep going until your brackets and text look like the above string.
11. Select the entire group of nested fields, then right-click them and select Toggle Field Codes.

Display a page number that is greater by one than the actual page number (on every page except the last page). <Top of Page>

Solution:
Insert into the header or footer an "if" field (special hidden instruction) that tells Word to insert nothing if on the last page but insert a value equal to the page number plus one if NOT on the last page.

Notes:
Inserting the field into the header or footer will assure that it will be present on the last page (and indeed all other pagges), no matter how many pages the document contains. Even though present on all pages, it will cause a number to appear only on pages that are NOT the last page.

The field in this case will be a compound entity that consists of four fields nested within a fifth field. It will look approximately like this:
{IF { PAGE } < { NUMPAGES } { = {PAGE} + 1 \* MERGEFORMAT} }
The braces shown here were typed manually. The braces in the actual field will look slightly different, because Word will insert them using special characters that look slightly different.

Insert the required field into your doc:
1. On the View menu, choose Page Layout.
2. On the View menu, choose Header and Footer
3. Scroll up or down (if needed) until you can see the header or footer where you want the page number to appear.
4. Click where you want the page number to appear (could be at the beginning of a line, or just after a tab character, etc. etc.)
5. Press Ctrl+F9 to insert a set of field braces.
6. Inside the braces, type the expression shown below, using arrow keys to navigate within the field and Ctrl+F9 to insert additional braces as needed:
{IF { PAGE } < { NUMPAGES } { = {PAGE} + 1 \* MERGEFORMAT} }
7. Select the entire field expression, starting with the first opening brace and ending with the last closing brace.
8. Right-click the selected area and choose Toggle Field Codes. This will tell Word to hide the field from view.
9. On the View menu, choose Header and Footer to close the header and footer view and return the cursor to the main document.

Tell Word to update the field with the current results:
1. To tell Word to update the field just before printing, click Options on the Tools menu, then choose the Print tab at the top of the dialog box and place a checkmark in the Update Fields checkbox.
2. To tell Word to update the field immediately, view the header or footer, then right-click the field and select Update Field. (Make sure you're not on the last page of your document when you do this, or there'll be nothing to see after the field is updated!)

For more information about fields:

Choose Field on the Insert menu. Then click the What's This? Button and choose a field code. Word will display a definition of the field with examples of how the code can be used.

In a document divided into sections, display the section number, or a derivative of it, in the footer of a document. <Top of Page>

Solution:
If section 1 always represents the main document and sections 2 - X represent the attachments, you can number the attachments without numbering the main document by using a nested field in the footer. Here's what the field expression should look like:
{ If { Section } > 1 "Attachment { = { Section } - 1 }" "" }
Use Ctrl + F9 to enter the brackets. Use the arrow keys to move the cursor from one set of brackets to another and type the expression as it appears here. Make sure you leave a space before and after the > sign.

Prevent a user from opening the headers and footers for editing. <Top of Page>

Solution:
Insert a continuous section break at the start of your document, then choose Protect Document on the Tools menu and protect Section 1 for forms. Credit: Ray Wellington.