Nested IF MERGEFIELD statements

R

rushak

I'm trying to apply the logic of IF MERGEFIELD A = A and IF MERGEFIELD B = B
DO this. I haven't successfully been able to do this. Does anyone have any
suggestions. This is what I have gotten so far, but I can't seem to get the
syntax correct:

{IF {MERGEFIELD PropertyState} = "OR" "{IF {MERGEFIELD Investor} = "VA" "The
result when the condition is met" "The result when the condition is not
met"}"}
 
G

Greg Maxey

Rushak,

You do the braces OK

{IF {MF A} = "A""{IF {MF B} = "B""Conditions Met""Conditions Not
Met"}""Conditions Not Met"}
 
R

rushak

Greg,

I edited my statement to how you have it shown and when I update the field
it shows the False condition, but when I actually do the mail merge with my
data source, I get no results....not even my false condition. The logic
makes sense. I've broken out each IF MF on a seperate line to verify the
data is correct which it is. Thanks for your help. I forgot to mention this
is Word 2002.

Rushak.
 
G

Greg Maxey

Rushak,

As far as I can tell the construction is right. You might try confirming
your construction with a few bookmarks and REF fields located in your
document. If you can make that work, then substitute the REF fields with
your merge fields.
 
G

Graham Mayor

I assume that you have used CTRL+F9 to set each pair of field boundaries? If
so, Greg's construction should work - to clarify, using your original
example and assuming that OR and VA are actual results both of which need to
be true:

{IF {MERGEFIELD PropertyState} = "OR" "{IF {MERGEFIELD Investor} = "VA" "The
result when the condition is met" "The result when the condition is not
met"}"The result when the condition is not met"}

It might help to insert a {Mergefield PropertyState} field and a {Mergefield
Investor} field in your merge document to ensure that they do actually
produce OR and VA.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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