Share via

Using IF field to insert conditional text based on the current page number.

Anonymous
2015-11-18T23:41:21+00:00

I have  a header in which I want to insert a field (IF..Then...Else) to test for the current page number and display conditional text.

Example: if the current page is > 1, display "Comments (cont.)" ELSE display "Comments"

How do I test for the current page?

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

Paul Edstein 82,861 Reputation points Volunteer Moderator
2015-11-19T00:17:17+00:00

Such a field would be coded as:

{IF{PAGE}= 1 "Comments" "Comments (cont.)"}

Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. The spaces represented in the field construction are all required.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

Answer accepted by question author

Suzanne S Barnhill 278.1K Reputation points MVP Volunteer Moderator
2015-11-19T00:14:48+00:00

Well, you could use { IF { PAGE } > 1 "Comments (cont.)" "Comments" }, where the braces must be inserted using Ctrl+F9 (though you can use Alt+Shift+P to insert the PAGE field).

An easier solution, however, is to enable Different First Page and put "Comments" in the First Page Header and "Comments (cont.)" in the primary Header, which appears on pp. 2ff.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful