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" wrote:
{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" wrote in message
news
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.