Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IF Field and Conditional Even Page

0 views
Skip to first unread message

LMK

unread,
Aug 28, 2000, 3:00:00 AM8/28/00
to

Word2000 has thrown another curve that I can't solve via the Help.
I tried to follow the instruction given by John McGhie on the FAQ page
at http://www.mvps.org/word/FAQs/TablesFieldsForms for
automatically inserting an even page at the end of a chapter that
would otherwise end on an odd page.

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

Suzanne S. Barnhill

unread,
Aug 28, 2000, 3:00:00 AM8/28/00
to

Did you insert an actual page break (not just the text "[page break]")?

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

LMK

unread,
Sep 1, 2000, 5:26:01 PM9/1/00
to
Suzanne,

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

unread,
Sep 1, 2000, 6:55:58 PM9/1/00
to

It's possible you just need some more spaces in the field code (it looks
pretty tightly wrapped to me). But since John McGhie is the author of this
syntax, perhaps he can come back and explain it better. I can see what it is
supposed to do, but I've never actually tried it.

--
Suzanne S. Barnhill
Microsoft Word MVP
Words into Type
Fairhope, AL USA

LMK <Lillian...@midata-ebs.com> wrote in message

news:#dulmsFFAHA.56@cppssbbsa04...

Doug Robbins

unread,
Sep 2, 2000, 6:51:45 AM9/2/00
to

Hi Lili,

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

LMK

unread,
Sep 6, 2000, 11:05:38 AM9/6/00
to

Doug's comment about spacing is *part* of the problem. At least now I
get the word "Notes" to display, and I can Shift+F9 to redisplay the
field code.

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


Dave Rado

unread,
Sep 9, 2000, 6:55:33 AM9/9/00
to

Email your doc to me if you like and I'll have a look.

Regards

Dave

"LMK" <Lillian...@midata-ebs.com> wrote in message

news:O9jQOPB...@cppssbbsa02.microsoft.com...

0 new messages