Another skip blank line

H

hlock

I have a merge letter addressed as follows:

{MERGEFIELD INSNAM}
{MERGEFIELD "INSAD1"}
{MERGEFIELD "INSAD2"}
{MERGEFIELD "INSAD3}
{MERGEFIELD "INSCITY"}, {MERGEFIELD "INSST"} {MERGEFIELD "INSZIP"}

If INSAD2 is blank, I don't want a blank line. I want it to skip to INSAD3.
IF INSAD3 is empty, I want it to skip to INSCITY, also without leaving a
blank line. How do I code this so that the blank line is skipped when I
merge my file?

Also, sometimes, I get a large space after the INSCITY, but before the
INSST. For example:
PHOENIX , AZ
How do I elimate the blank space at the end of a field?
Thanks for anyone's suggestions.
 
D

Doug Robbins - Word MVP

{MERGEFIELD INSNAM}
{MERGEFIELD "INSAD1"}
{ IF {MERGEFIELD "INSAD2"} <> "" "{MERGEFIELD "INSAD2"}[ENTER]
{ IF {MERGEFIELD "INSAD3} <> "" "{MERGEFIELD "INSAD3}[ENTER]
{MERGEFIELD "INSCITY"}, {MERGEFIELD "INSST"} {MERGEFIELD "INSZIP"}"
"{MERGEFIELD "INSCITY"}, {MERGEFIELD "INSST"} {MERGEFIELD "INSZIP"}" }
"{ IF {MERGEFIELD "INSAD3} <> "" "{MERGEFIELD "INSAD3}[ENTER]
{MERGEFIELD "INSCITY"}, {MERGEFIELD "INSST"} {MERGEFIELD "INSZIP"}"
"{MERGEFIELD "INSCITY"}, {MERGEFIELD "INSST"} {MERGEFIELD "INSZIP"}" }" }

Press the Enter key wherever [ENTER] is located in the above construction.

The spaces between the City and the State must be in the data source and
will need to be removed from there.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
R

ReDDeR

I have a tougher nut to crack.

If I have the following:
{MERGEFIELD A}
{MERGEFIELD B}
{MERGEFIELD C}
{MERGEFIELD D}
{MERGEFIELD E}
{MERGEFIELD F}
{MERGEFIELD G}

If I have blank fields from B to F in my Excel worksheet, and I don't want
Word to leave blank lines during mail merge, instead I want it to just show
field A and G. How do you do this?

Using "IF" function in Excel is so much easier than Word.

Any help from Word gurus out there?

Red


Doug Robbins - Word MVP said:
{MERGEFIELD INSNAM}
{MERGEFIELD "INSAD1"}
{ IF {MERGEFIELD "INSAD2"} <> "" "{MERGEFIELD "INSAD2"}[ENTER]
{ IF {MERGEFIELD "INSAD3} <> "" "{MERGEFIELD "INSAD3}[ENTER]
{MERGEFIELD "INSCITY"}, {MERGEFIELD "INSST"} {MERGEFIELD "INSZIP"}"
"{MERGEFIELD "INSCITY"}, {MERGEFIELD "INSST"} {MERGEFIELD "INSZIP"}" }
"{ IF {MERGEFIELD "INSAD3} <> "" "{MERGEFIELD "INSAD3}[ENTER]
{MERGEFIELD "INSCITY"}, {MERGEFIELD "INSST"} {MERGEFIELD "INSZIP"}"
"{MERGEFIELD "INSCITY"}, {MERGEFIELD "INSST"} {MERGEFIELD "INSZIP"}" }" }

Press the Enter key wherever [ENTER] is located in the above construction.

The spaces between the City and the State must be in the data source and
will need to be removed from there.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

hlock said:
I have a merge letter addressed as follows:

{MERGEFIELD INSNAM}
{MERGEFIELD "INSAD1"}
{MERGEFIELD "INSAD2"}
{MERGEFIELD "INSAD3}
{MERGEFIELD "INSCITY"}, {MERGEFIELD "INSST"} {MERGEFIELD "INSZIP"}

If INSAD2 is blank, I don't want a blank line. I want it to skip to
INSAD3.
IF INSAD3 is empty, I want it to skip to INSCITY, also without leaving a
blank line. How do I code this so that the blank line is skipped when I
merge my file?

Also, sometimes, I get a large space after the INSCITY, but before the
INSST. For example:
PHOENIX , AZ
How do I elimate the blank space at the end of a field?
Thanks for anyone's suggestions.
 

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