Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 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

Written by Allen Wyatt (last updated January 10, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


6

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 Microsoft 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. ...

MORE FROM ALLEN

Store Common Addresses in Building Blocks

Do you write letters to lots of different people? One good place to keep those addresses is in Building Blocks. They are ...

Discover More

Selecting a Paper Size

Excel can print your worksheet on just about any paper size you can imagine. How you select the paper size you want used ...

Discover More

Cropping Graphics

Need your hide some of the outside edges of a graphic? You can instruct Word to crop (or hide) those outside edges by ...

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)

Deleting All Headers and Footers

Headers and footers add a finishing touch to documents, but sometimes they can be bothersome. You may need to remove them ...

Discover More

Preventing the Left Margin of a Footer from Moving

When you print a document, does the position of the page footer seem to move left and right? This could have to do with ...

Discover More

Placing the First Two Words from the Following Page In the Footer

Headers and footers can be used for all sorts of information to help orient your document reader. In fact, Word provides ...

Discover More
Subscribe

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

View most recent newsletter.

Comments

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}] (all 7 characters, in the sequence shown) 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 8 + 7?

2023-01-25 20:25:53

Viv

Ok after an hour of trial and error I got it to work BUT it does not translate any code used in the content. Help?!


2020-08-16 07:51:31

YossiD

@Diana - I feel your pain. It seems completely absurd that your version of Word won't let you insert a one-page section at the end of your document, with its own un-linked header/footer. I am in Word 2007 and I can do that just fine.

I have fond memories of WordPerfect; too bad it died.


2020-08-15 12:44:30

Diana Verhulst

@Yossid - Some versions of Word don't allow you to do that. I've been struggling for days now with my Word document to insert "This is the last page" on the past page footer, and no matter what I do - and I've been using other versions of Word my entire adult life (I'm old enough to remember Word Perfect), I cannot get it to take. I'm doing something wrong, but from a few things I've just read this morning, I think the Word version I'm using (and I'm not certain what that is right now) (I'm at home) - I do know it's a newer version, Probably 2015 or 2016). I'm going to try the field insert he mentioned here (which I tried once already but I didn't do it right, so going to go back again). This is such a freaking simple request. I just want to put "Continued on next page...." on each page but the last, and put "This is the last page" on the last page, except I also want to insert an object as the last page (a pdf) after THAT. The time it took for me to try doing this was a waste as the footer was not mandatory. But I wanted it there. Anyway .... I know there's a way to do it but with the series of steps involved, I'm exhausted.


2019-07-09 05:05:30

Isaac

How can i use this method with images instead of text?


2019-04-08 05:45:42

Richard

I expect this gets more complicated if I format the page numbers, e.g. by using pages i to iv for preliminary pages, followed by 1 to 20 for the content. The NUMPAGES field would contain 24 but the page number would never reach that.


2019-04-07 01:52:02

YossiD

This is an interesting method, but why not just make the last page a new section with its own header and/or footer?


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.

Videos
Subscribe

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.