Testing against Multiple Variables

C

Clive

Hi there.

I am trying to implement word merges using Word 2002.I
would like to test two variables and if both
are blank insert a text message. If either exist I would
like to insert one or the other or both. My best guess
(which doesn't work)has been the following:

IF "{{{MERGEFIELD FIRST} <> "" } OR
{{MERGEFIELD SECOND} <> "" }
"{MERGEFIELD FIRST}{MERGEFIELD SECOND}" "none"

Is there another way to write IF statements other than
toggling variables and hacking away at the exposed code.
Can one use wordpad and paste the statements into the
document?

Thanks
Clive
 
G

Graham Mayor

The idea is right - the syntax wrong :)

{IF {Mergefield First} <> "" "{Mergefield First}" "{IF {Mergefield Second}
<> "" "{Mergefield Second}" "None"}"}

Assemble the fields using CTRL+F9 to place the pairs of field boundaries.
No - you can't paste from Wordpad.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail (e-mail address removed)
Web site www.gmayor.dsl.pipex.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top