Suppress Blank Lines in Address (Word 2000-2003)

W

Wobbs

Hi All

I'm trying to suppress blank lines in address data. All is fine when I use
the following info:

This Works:
{ MERGEFIELD ClientAdd1 }{ IF { MERGEFIELD ClientAdd1 } = "" "" " " }
{ MERGEFIELD ClientAdd2 }{ IF { MERGEFIELD ClientAdd2 } = "" "" " " }
{ MERGEFIELD ClientAdd3 }{ IF { MERGEFIELD ClientAdd3 } = "" "" " " }
{ MERGEFIELD ClientAdd4 }{ IF { MERGEFIELD ClientAdd4 } = "" "" " " }
{ MERGEFIELD ClientAdd5 }{ IF { MERGEFIELD ClientAdd5 } = "" "" " " }
{ MERGEFIELD ClientPostCode }


My problem is one of my documents has a flag that switches the address of
where we would send the letter to. I have 5 lines of address info that are
unspecified by what address type data it holds except the Post Code (Zip
Code).

With regards to the above - address fields look like this:

{ IF { MERGEFIELD AddFlag } = 0 { MERGEFIELD ClientAdd1 }{ MERGEFIELD
CustomerAdd1 } }
{ IF { MERGEFIELD AddFlag } = 0 { MERGEFIELD ClientAdd2 }{ MERGEFIELD
CustomerAdd2 } }
{ IF { MERGEFIELD AddFlag } = 0 { MERGEFIELD ClientAdd3 }{ MERGEFIELD
CustomerAdd3 } }
{ IF { MERGEFIELD AddFlag } = 0 { MERGEFIELD ClientAdd4 }{ MERGEFIELD
CustomerAdd4 } }
{ IF { MERGEFIELD AddFlag } = 0 { MERGEFIELD ClientAdd5 }{ MERGEFIELD
CustomerAdd5 } }
{ IF { MERGEFIELD AddFlag } = 0 { MERGEFIELD ClientPostCode }{ MERGEFIELD
CustomerPostCode} }

Can anybody tell me how I can suppress blank lines of this address data
while maintaining the Flag to check for where the letter should be sent to?
 
G

Graham Mayor

The usual schematic for missing fields is

{ MERGEFIELD ClientAdd1 }{ IF { MERGEFIELD ClientAdd2 } = "
{ MERGEFIELD ClientAdd2 }" }{ IF { MERGEFIELD ClientAdd3 } = "
{ MERGEFIELD ClientAdd3 }" }{ IF { MERGEFIELD ClientAdd4 } = "
{ MERGEFIELD ClientAdd4 }" }{ IF { MERGEFIELD ClientAdd5 } = "
{ MERGEFIELD ClientAdd5 }" }
{ MERGEFIELD ClientPostCode }

or for your alternative address

{ MERGEFIELD CustomerAdd1 }{ IF { MERGEFIELD CustomerAdd2 } = "
{ MERGEFIELD CustomerAdd2 }" }{ IF { MERGEFIELD CustomerAdd3 } = "
{ MERGEFIELD CustomerAdd3 }" }{ IF { MERGEFIELD CustomerAdd4 } = "
{ MERGEFIELD CustomerAdd4 }" }{ IF { MERGEFIELD CustomerAdd5 } = "
{ MERGEFIELD CustomerAdd5 }" }
{ MERGEFIELD CustomerPostCode }

Thus { IF { MERGEFIELD AddFlag } = 0 "Client address" "Customer Address"

i.e.

{ IF { MERGEFIELD AddFlag } = 0 "{ MERGEFIELD ClientAdd1 }{ IF {
MERGEFIELD ClientAdd2 } = "
{ MERGEFIELD ClientAdd2 }" }{ IF { MERGEFIELD ClientAdd3 } = "
{ MERGEFIELD ClientAdd3 }" }{ IF { MERGEFIELD ClientAdd4 } = "
{ MERGEFIELD ClientAdd4 }" }{ IF { MERGEFIELD ClientAdd5 } = "
{ MERGEFIELD ClientAdd5 }" }
{ MERGEFIELD ClientPostCode }" "{ MERGEFIELD CustomerAdd1 }{ IF {
MERGEFIELD CustomerAdd2 } = "
{ MERGEFIELD CustomerAdd2 }" }{ IF { MERGEFIELD CustomerAdd3 } = "
{ MERGEFIELD CustomerAdd3 }" }{ IF { MERGEFIELD CustomerAdd4 } = "
{ MERGEFIELD CustomerAdd4 }" }{ IF { MERGEFIELD CustomerAdd5 } = "
{ MERGEFIELD CustomerAdd5 }" }
{ MERGEFIELD CustomerPostCode }" }

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
W

Wobbs

Thanks for the quick response - I really appreciate it.

I give it a go and let you know how I get on - I'm not that familiar with
merge field data so this has been a bit of a struggle trying to figure it out.

Thanks again.
 

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