Group:  Microsoft Word ยป microsoft.public.word.mailmerge.fields
Thread: Using AND in a field code

Using AND in a field code
Simon 12/22/2008 5:16:09 PM
I'm trying to use field codes, and distilled down to a test case with a
formula embedded in the first IF expression:

{IF {=AND(1<2,1<3)} = 1 "OK" "BAD"}

Looks simple enough - but I can't get this to display 'OK' - even when I
update the field. I did see it work - but now it's gone again. Seems utterly
unreliable. Is this a bug and is there a fix?
RE: Using AND in a field code
Astrid 12/22/2008 5:43:01 PM
Hi Simon,

Just a thought, depending on your location and international settings of
your system, the ',' in the formula could be need to replace with ';'

"Simon" wrote:

[Quoted Text]
> I'm trying to use field codes, and distilled down to a test case with a
> formula embedded in the first IF expression:
>
> {IF {=AND(1<2,1<3)} = 1 "OK" "BAD"}
>
> Looks simple enough - but I can't get this to display 'OK' - even when I
> update the field. I did see it work - but now it's gone again. Seems utterly
> unreliable. Is this a bug and is there a fix?
Re: Using AND in a field code
"macropod" <macropod[ at ]invalid.invalid> 12/22/2008 9:51:16 PM
Hi Simon,

Delete the space before the '=' sign.

So, instead of:
{IF {=AND(1<2,1<3)} = 1 "OK" "BAD"}
use:
{IF {=AND(1<2,1<3)}= 1 "OK" "BAD"}

Note too that both sets of field brace pairs (ie '{ }') for the field code are created via Ctrl-F9 - you can't simply type them or
copy & paste them from this message.

For more information on doing this and a wide range of other calculations in Word, check out my Word Field Maths 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=365442
or
http://www.gmayor.com/downloads.htm#Third_party

--
Cheers
macropod
[MVP - Microsoft Word]


"Simon" <Simon[ at ]discussions.microsoft.com> wrote in message news:917F3014-8DC6-4148-BE7F-A69F934C677C[ at ]microsoft.com...
[Quoted Text]
> I'm trying to use field codes, and distilled down to a test case with a
> formula embedded in the first IF expression:
>
> {IF {=AND(1<2,1<3)} = 1 "OK" "BAD"}
>
> Looks simple enough - but I can't get this to display 'OK' - even when I
> update the field. I did see it work - but now it's gone again. Seems utterly
> unreliable. Is this a bug and is there a fix?

Home | Search | Terms | Imprint
Newsgroups Reader