how do I insert carriage return into mergefield

C

Chieferman

I have a conditional form field in a word document.
Here is the code:
IF {|PRIMARY_INSURED|Primary_Address2|}=<>" " " { Enter Primary
Address2 ^|PRIMARY_INSURED|Primary_Address2|10004,10150,53|ATTRIBUTE|
^ }"

So what I am saying is if the address2 is blank don't enter anything.
If it has a value enter that value. But since I have put this form
field to the right of another form field for address 1 I want to put
the address 2 on the next line. In other words I want to insert a
carriage return line feed in the code.
 
D

dedawson

OK, the good news is, it's doable. I have MailMerge forms I developed
for exactly that purpose.

The bad news is that it's a pain getting there.

The trick is that you have to use nested If and Compare fields to
determine if the second address exists, then include your carriage
return within the quotes that contain the Mergefield that you want to
conditionally print (the second address) if it exists. Make sense?
Take a look at the help for the 'Field Codes: IF field' it might help
to make things a bit clearer.

Basically, buried in all your Field stuff, you're going to have
something along the lines of:

(compare {mergefield address2}<> ""} ) } = 1"
{mergefield address2}"

Note that there's a lot more that went in front of all this to help
determine whether to print or not. The key point though, is that you
place your carriage return immediately after the opening quote that
defines what you want to print.

Hope this helps, just sorry it's so wordy and convoluted
 
C

Chieferman

I'm sorry but I'm not following. And I hope I am making myself
clear. I can put the IF statement in and display the 2nd address if
it exists and display nothing if it doesn't. I'm just struggling to
get the 2nd address to be put under the 1st address. I have tried all
kinds of suggestions although I'm not understanding the compare syntax
you described.
I have tried placing my curser just past the first " and hitting
Enter. (I believe that is what I am supposed to do) But Word ignores
that.

I've tried it this way with the carriage return right after the last "
in the next row.
IF {|PRIMARY_INSURED|Primary_Address2|}=<>" " "
{ Enter Primary
Address2 ^|PRIMARY_INSURED|Primary_Address2|10004,10150,53|ATTRIBUTE|
^ }"

I don't understand the significance of the ^ symbols. I'm using this
with a java based database application that automatically fills the
merge fields into a word template. But I'm pulling my hair out here.
 

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