Reply
 
Thread Tools Display Modes
  #1   Report Post  
graatje
 
Posts: n/a
Default AND OR operator won't work

With a mail merge I want to check if the fields "company" and "name" are
filled (not empty)if this is true then the text "attn. " has to be placed
before the name. Somehow it won't work, does anybody know why?

{COMPARE{MERGEFIELD company} ""}

{COMPARE{MERGEFIELD name}""}

IF{=AND({COMPARE{MERGEFIELD company} ""},{COMPARE{MERGEFIELD
name}""})}=1 "true" "false"}

Here the result of some fields:

0

1

false


1

1

false



The first two comparisions went well, the AND function doesn't seem to work,
whatever I change it remains "false", even if I replace AND with OR. Please
help.


  #2   Report Post  
Graham Mayor
 
Posts: n/a
Default

Try
{ IF{ mergefield name } "" "{ IF{ mergefield company } "" "attn."
"" }" "" }

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


graatje wrote:
With a mail merge I want to check if the fields "company" and "name"
are filled (not empty)if this is true then the text "attn. " has to
be placed before the name. Somehow it won't work, does anybody know
why?

{COMPARE{MERGEFIELD company} ""}

{COMPARE{MERGEFIELD name}""}

IF{=AND({COMPARE{MERGEFIELD company} ""},{COMPARE{MERGEFIELD
name}""})}=1 "true" "false"}

Here the result of some fields:

0

1

false


1

1

false



The first two comparisions went well, the AND function doesn't seem
to work, whatever I change it remains "false", even if I replace AND
with OR. Please help.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:35 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"