4

I have a field code with a strange behavior. When I put the code,

{ IF NUMPAGES=NUMPAGES "A" "B" }

I get A as expected however, when I reverse this, ie

{ IF NUMPAGES<>NUMPAGES "A" "B" }

I still get A.

Why is this happening?

1 Answer 1

1

You need to say

{ IF NUMPAGES <> NUMPAGES "A" "B" }

Word Help: Field codes: IF field says,

Operator

Comparison operator.  Insert a space before and after the operator.
                        ⋮

I can't find this documented anywhere, but it looks like Word is interpreting your code as

IF "NUMPAGES<>NUMPAGES" ≠ "" ... 
1
  • 1
    Just as a followup, it needs to have braces around NUMPAGES, ie { IF { NUMPAGES } <> { NUMPAGES } "A" "B" } Jun 22, 2015 at 12:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .