Word Insert Page Break if Field matches criteria

I need to insert a page break after a record if the "Job" field is equal to "LABOR"  

I see you can use If...Then...Else statements in word, but can't figure out how to insert a page break.
maverick0728Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

n2fcCommented:
See the following article for syntax of "if then else":
https://support.office.com/en-au/article/Field-codes-IF-field-9f79e82f-e53b-4ff5-9d2c-ae3b22b7eb5e

To insert a page break, use:    CTL+ENTER
Eric FletcherCommented:
The trick is to create your IF field code to include the page break as the action. If you type it in (with Ctrl-Enter), you'll get unwanted paragraph marks and it will be hard to follow. I suggest you start by switching to Draft view, showing hidden characters (the ¶ button), and toggling the field code view (Alt-F9).

Press Ctrl-F9 to get the field code braces where you need to IF statement. Then copy (or type in) the field exactly as follows within the braces: IF Job = Labor "xx" "" (If you have smart quotes turned on, be sure to press Ctrl-Z after typing each " symbol so you won't have the curly quotes; the formula needs the inch symbol quote marks.)

Now select the xx and press Ctrl-Enter to get the page break token as the action if Job is equal to Labor.

Tip: To make it much easier to work with field codes in Word, use File > Options > Advanced, then scroll down to the "Show document content" area to set Field shading: Always. This will cause field codes and their results to be displayed with a light gray shading. The gray won't print, but it will let you see when content is from a calculated field code rather than just typed in. Alt-F9 will toggle between field codes and their results.

The screen grabs below show how this effect appears with the attached sample file.Screen capture showing field code to insert conditional page breaksIn my example file, the SET field code assigns values to bookmarks; the ][ symbol appears because I have another "Show document content" option turned on to identify bookmarks.
eeQ28737103_InsertPageBreakIfsample.docx

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.