Share via

Adding a footer to only the last page of an expanding document. (Document 1-3 pages)

Anonymous
2024-10-02T23:44:32+00:00

I'm having an issue with adding a footer to only the last page of an expanding document. Most of the time, this document will be one page long, but occasionally, two or three. If I use { IF { PAGE } = { NUMPAGES } "" "" } no footer shows up when the document is one page long. Alternatively the following code: { IF { OR { = { PAGE } { NUMPAGES } } { = { NUMPAGES } 1 } } "" "" } has a footer on every page. No matter how I modify the code, I cannot have it show up on the last page only. The section break method didn't work for me because it automatically adds a second page.

[Title changed by moderator to provide information that document will be 1-3 pages.]

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Charles Kenyon 166.7K Reputation points Volunteer Moderator
    2024-10-02T23:54:11+00:00

    This will take a calculation field. The page number is part of the footer text. That is what you are attempting.

    See Footer on last page.

    For the one-page document, you could use the Different First Page setting.

    Otherwise, you could use a more complex nested IF field where you first test for a single page.

    Nested IF Fields - A method to create them

    Edit: See third response below about using automatic Word feature of different headers and footers.]

    2 people found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Charles Kenyon 166.7K Reputation points Volunteer Moderator
    2024-10-03T02:32:35+00:00

    ***

    Since my document will never go past 3 pages,...

    ***

    For a document that will be between one and three pages, you can simply use both the Different First Page and Different Even and Odd settings.

    You simply make the footers you want for each of these categories.

    You won't need any fields other than the { Page } field.

    The first-page header/footer will always be on page 1.

    The even-page header/footer will always be on page 2 and all subsequent even-numbered pages, of which there should be none.

    The odd-page header/footer will always be n later odd-numbered pages such as page 3.

    1 person found this answer helpful.
    0 comments No comments
  2. Suzanne S Barnhill 277.1K Reputation points MVP Volunteer Moderator
    2024-10-03T01:01:07+00:00

    Are you saying that you don't want a footer if the document is just one page long? If you use the field { IF { PAGE } = { NUMPAGES } "Footer for last page" }, you will get the footer only on the last page. If you want a different footer on preceding pages, you can add { IF { PAGE } < { NUMPAGES } "Content for pages before the last" }. But if you use the first field, it will appear on page 1 if there is just one page.

    0 comments No comments
  3. Charles Kenyon 166.7K Reputation points Volunteer Moderator
    2024-10-03T00:59:59+00:00

    Thank you for the information. I went ahead and made a nested field with a longer IF statement. Since my document will never go past 3 pages, I set conditions for each scenario. { IF { NUMPAGES } = 1 "Footer Text for Page 1" { IF { NUMPAGES } = 2 { IF { PAGE } = 2 "Footer Text for Page 2" "" } { IF { PAGE } = 3 "Footer Text for Page 3" "" } } }

    I also learned that MS Word doesn't automatically update fields when adding or deleting content. (This is why I thought my previous attempts didn't work). I had to double click on the footer section and then they update to my desired placement.

    In most setups, going to Print Preview and back will update fields in the header or footer.

    0 comments No comments
  4. Anonymous
    2024-10-03T00:22:39+00:00

    Thank you for the information. I went ahead and made a nested field with a longer IF statement. Since my document will never go past 3 pages, I set conditions for each scenario. { IF { NUMPAGES } = 1 "Footer Text for Page 1" { IF { NUMPAGES } = 2 { IF { PAGE } = 2 "Footer Text for Page 2" "" } { IF { PAGE } = 3 "Footer Text for Page 3" "" } } }

    I also learned that MS Word doesn't automatically update fields when adding or deleting content. (This is why I thought my previous attempts didn't work). I had to double click on the footer section and then they update to my desired placement.

    0 comments No comments