Label Merge

M

mmdmyoung

I have a datasource created in excel. Included in the list are name,
address1, address2, city, state, zip. The problem is when I import them into
excel, if there are blanks for address2, I get a blank line on my labels. Is
there any way the blank line can be eliminated on the label if there is not
an address2.

Thanks!
 
S

Suzanne S. Barnhill

Yes. You need to use an IF field that prints address2 if it exists, along
with a line break. Since the line break will be included only if the address
is printed, you will not get a blank line. The syntax of the field should be
as follows:

{ IF { MERGEFIELD address2 } = "" "" "{ MERGEFIELD address2 }
" }

Note the line break between the mergefield and the closing quote in the
FalseText in this field.

Although you can get a start on this IF field using the Insert Word Field
button on the Mail Merge toolbar, it will not permit you to insert a
mergefield as your FalseText; you'll have to insert a placeholder and then
manually edit the IF field, so you might as well create it manually to begin
with:

1. Press Ctrl+F9 to insert the outside field delimiters (the things that
look like braces but can't be entered from the keyboard).

2. Between the field braces, type all the content except the mergefields.

3. Use the Insert Merge Field button to insert { MERGEFIELD address2 } in
the two locations where it is needed.

4. F9 to update/toggle the field code.

Alternative syntax for the field (which uses the merge field as the TrueText
and eliminates the FalseText) is:

{ IF { MERGEFIELD address2 } <> "" "{ MERGEFIELD address2 }
" }

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 

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