Skip to main content
I am trying to create a mail merge template that contains conditional 'IF' statements.  I can't get it to work and am wondering if it even does.  What I read online is conflicting.  Here is what I am attempting:

 

1. I am using CTRL-F9 to create the merge fields

 

2. I am in Office 2007, but am saving it in Office 97 - 2003 format

 

3. I am using Extended Mail Merge (XMM).  (I can't use the old app for it)

 

The simple merge field is working.  What isn't working is the conditional 'IF' statement.  I don't know if this is me or if it just doesn't work.  Other people do seem to have gotten IF statements to work, but it isn't clear to me if they were using XMM.

 

Here is what my template looks like:

 

----------------------------

 

This is a Mail Merge test.

 

{ IF { MERGEFIELD Contact_FirstName } = "Steve"

 

"The IF statement knows that the Contact's first name is { MERGEFIELD Contact_FirstName }."

 

"The IF statement thinks the Contact's first name is { MERGEFIELD Contact_FirstName }" }

 

The Contact's first name is: { MERGEFIELD Contact_FirstName }.

 

End of Mail Merge test.

 

---------------------------

 

And here is what I'm getting (the first name is in fact "Steve")

 

------------------------

 

This is a Mail Merge test.

 

The Contact’s first name is: Steve.

 

End of Mail Merge test.

 

--------------------

 

So you can see that it is handling the simple merge field condition correctly.  Just not the IF statement.

 

Can XMM handle IF statements in mail merge templates?

 

Thanks!
1 réponse
  1. 6 juil. 2015, 20:56
    Try this post

     

    https://success.salesforce.com/ideaView?id=08730000000BrdX

     

    Few of them have already posted their workaround. My suggestion would be to get a formula field within the object and then use a workflow to get it to another text field and use that text field in your mail merge.

     

    In short, rather than doing the manipulation in the mail merge do it all within the object and use the field directly on your XMM. It should work easier.
0/9000