I entered the 3 nested fields with Ctrl+F9, and typed in the contents
as directed, being careful about spacing:
{ IF{ =MOD({ PAGE },2)}= 0 " " "
[page break]
Notes" }
When I try to update the field in my document, I get:
"Error! Unknown op code for conditional."
When I use Shift+F9 to re-display the field code, I get:
"{IF0.0=0"""
[page break]
Notes
" }
I also tried entering the IF statement with Insert--Field Code, but
could not figure out what exactly the expression is for designating
an odd page. And Word won't insert the IF field without referring
to a bookmark. (Huh?) The Help explanation <g> is arcane at best.
(At worst trying to search it causes an invalid page fault. :-(( )
What does the item MOD mean in John's example? What am I missing?
Lili
MOD is a function (modulus) that divides a given number (in this case the
page number, denoted by the { PAGE } field) by another number (in this case
2) and reports the remainder. This is a method of testing for
evenness/oddness. In other words, if you divide the page number by two and
the remainder is 0, the page number is even. If the remainder is 1, it is
odd. The result in this case is to insert nothing (represented by the quotes
with space between them, though you can also have them without a space) if
the result is 0. If it is not zero (that is, if it is 1, meaning that the
page is odd), it inserts a page break and whatever text you want at the top
of the page (in this case John has supplied the heading "Notes.") You can
read more about the MOD function in Word's Help file under "Functions used
by the = (Formula) field," which you can get to from "formulas, fields"
(click on "functions").
--
Suzanne S. Barnhill
Microsoft Word MVP
Words into Type
Fairhope, AL USA
LMK <Lillian...@midata-ebs.com> wrote in message
news:u9bHTRSEAHA.247@cppssbbsa05...
Thanks for your explanation. But I still cannot make this work.
Yes, I inserted the page break with Ctrl+Enter. I zoomed up the view
to check the spacing. I read the Help sections you referenced (thanks,
I never would have found the Functions discussion). The explanations
make more sense now that I understand the formula syntax. But
something is still wrong.
I've tried this several times, tweaking the spacing and checking what
I entered. I *cannot* figure out what is amiss. I still get
"Error! Unknown op code for conditional." as the field result. Then I
can't re-display the field code to edit it, as I get the truncated mess
noted in my first post.
Other than the page break, is there some part of this statement that
must NOT be typed, but entered in some automatic way? What else
should I check?
TIA,
Lili
*****************
--
Suzanne S. Barnhill
Microsoft Word MVP
Words into Type
Fairhope, AL USA
LMK <Lillian...@midata-ebs.com> wrote in message
news:#dulmsFFAHA.56@cppssbbsa04...
Make sure that you have a space either side of the second = sign in the
field construction
({ PAGE },2)} = 0
If you don't have that, you will get the error message that you mention.
Please post any follow-up or new questions to the Newsgroups so that others
may benefit therefrom or contribute thereto.
Hope this helps,
Doug Robbins - Word MVP
"Suzanne S. Barnhill" <sbar...@zebra.net> wrote in message
news:#00bNmGFAHA.292@cppssbbsa04...
To test the statement, I inserted another page with a few text characters
at the end of the chapter, so the IF field would fall on an even page.
The field-generated even page did not go away when I tried to update
the field. The new error message is "One or more of the fields in the
selection could not be updated."
Would John or someone who has made this work please comment?
Lili
Regards
Dave
"LMK" <Lillian...@midata-ebs.com> wrote in message
news:O9jQOPB...@cppssbbsa02.microsoft.com...