Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, and Word in Office 365. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Using Last-page Headers and Footers.

Using Last-page Headers and Footers

by Allen Wyatt
(last updated July 4, 2018)


Often it is desirable to insert something in the header or footer that you only want to appear on the last page. Word can be tricked into doing this because the number of pages in a document only equals the page number on the last page of a document! The header or footer can still contain information that you want printed on every page, but this field prints the document name and path on the final page footer only.

{ IF { PAGE } = { NUMPAGES } { FILENAME \p} }

If you want to print one footer on every page, but a different footer on the last page, you can do so by modifying this slightly. For instance, the following will print the filename on the last page, but different text on the other pages:

{ IF { PAGE } = { NUMPAGES } { FILENAME \p} "This is not the last page"}

You can also modify the header or footer so that it only prints on pages except the final page. For example, this allows you to add 'Continued ...' on all pages except the final page:

{ IF { PAGE } < { NUMPAGES } " Continued... " }

As you have learned in other WordTips, you can insert field braces by pressing Ctrl+F9, and you can nest different fields, as this tip requires. To create the header or footer you desire, open your document and follow these steps:

  1. If the document has several sections, position the insertion point anywhere in the section where you want the header or footer to appear.
  2. Display the Insert tab of the ribbon.
  3. In the Header & Footer group, click either Header or Footer, depending on which one you want to change. Word displays a drop-down list of options.
  4. Click Edit Header or Edit Footer, depending on which tool you clicked in step 3. Word displays the header or footer along with the Design tab of the ribbon.
  5. Enter the compound field you wish to use (as discussed previously in this tip).
  6. With the insertion point within the compound field you created, press Shift+F9 to collapse the field.
  7. On the Design tab of the ribbon click on Close Header and Footer.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (8712) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Office 365. You can find a version of this tip for the older menu interface of Word here: Using Last-page Headers and Footers.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Making Word Stop at the End of a Document when Reviewing Changes

The Track Changes tool is a great help when you want to see what edits have been made to a document. When you review ...

Discover More

Specifying Location for a Message Box

When writing macros, you may want to position a message box at a specific location on the screen. This can't be done in ...

Discover More

Collating Copies

When you print multiple copies of worksheets that require more than one page each, you'll probably want those copies ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Turning Off "Link to Previous" by Default

When you add a new section to a document, you may want the headers or footers in that section to be different from those ...

Discover More

Inserting the Date in a Header or Footer

Need today's date in the header or footer of your document? Here's how to get it there easily.

Discover More

Keyboard Shortcut to Access Header and Footer

Some folks like to avoid using the mouse whenever possible, preferring to leave their hands on the keyboard. If you are ...

Discover More

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is six minus 6?

2018-02-28 12:11:11


Is there a way to do this with an image? I would like the logo to only appear on the last page.


2017-02-24 03:44:14



I've used the instr for last page footer, but I'm unable to add a hyperlink inside the total instr.
Something like this :

{IF {PAGE} < {NUMPAGES} {HYPERLINK ""} "Not a hyperlink"}.

The result is the text '' on every page except the last one, but the link is unclickable.

Cand you help me with this ?

2017-01-16 14:53:25

Sarah Maniapik

I would like to put certain text in my footer last page, how can I do this? I have searched numerous google pages, youtube and everything else I can think of!!!

Can you help me?

2017-01-12 15:42:57



I've tried to use this tip to print a table on the last page only but it doesn't work for me !! Is this tip for text only or we can use it for other cases ? if yes, please how to proceed ?


2015-07-22 13:39:17

Irene Scallon

I have a mail merge document. On the last page of the document I want a different footer. The footer on all pages is Page 1 of 6. On the last page I want:

Blah blah blah

Name _______________ Date _____________

Page 6 of 6

I have the text and table saved as an Autotext entry called *Provider. Since the mail merge is done monthly and the number of pages will vary from month to month, how do I get this into the footer? Please advise.

2015-05-24 09:24:06


Orient: The error came in because you copy and pasted instead of following the instructions. Don't paste the braces; you create them by following the numbered steps.


2015-05-23 22:24:51


The only effect of this tip in my document created by Word 2013 is that the footer prints the inserted text exactly as above: i.e. it prints { IF { PAGE } < { NUMPAGES } " Continued... " }.

The instruction above were copied/pasted directly into the footer so there is no chance of error.

2015-04-29 08:55:58



Interesting and helpful tips. I Loved visiting this site.

Can u suggest me anything regarding excel. I am unable to use the similar command on excel. i.e last page footer

2015-04-16 14:11:21

Paula S

I have a table that will merge policies and addresses. I need to have the same footer on all pages except the last one. When I try the above tip, it works if I manually add rows to the table, forcing the creation of additional pages. When I actually merge the document, I get the footer that should be only on the last page printed on every page. Thoughts?

2015-03-30 15:06:06


I have used if statements and numpages before, however, using Word 2010 the last page does not print correctly unless I do a print preview first and then print, or I print the document twice?

2013-12-17 18:32:16

Bob Cutler

The simplest way to create the fields (using the "Continued..." example) is easy enough that a non-power user can follow the directions without extensive handholding:
1. Open the footer and enter the following text (it looks best at the left margin):

IF PAGE < NUMPAGES "Continued..."

2. Double-click on the word PAGE and press Ctrl-F9

3. Double-click on the word NUMPAGES and press Ctrl-F9

4. Select the entire entry (from IF to the closing quote) and press Ctrl-F9

5. Press the F9 key.

This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.