Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.programming,microsoft.public.word.newusers,microsoft.public.word.pagelayout
eggedd2k eggedd2k is offline
external usenet poster
 
Posts: 1
Default How do you suppress blank Address lines during a Word merge?

I'm having some problems getting the address part of the data source
to display correctly. I'm merging from an SQL data source/query.

In particular the County and Country parts are showing as blank lines
if the corresponding field is empty. Some
clients in our database do not have anything in the County or Country
fields and therefore I need these fields to
supress if they are blank - and instead display the PostCode line
instead - rather than showing as a blank line.

The fields codes are shown as below.

Can anyone show me how I need to format the County and Country fields
so that they don't display if they are empty BUT ensure that they
don't leave blank lines?

thanks very much

Field Codes:

{MERGEFIELD SEND_TO \*MERGEFORMAT}
{MERGEFIELD CLIENT_NAME \*MERGEFORMAT}
{MERGEFIELD ADDRESSDETAIL \*MERGEFORMAT}
{MERGEFIELD CITY \*MERGEFORMAT}
{MERGEFIELD COUNTY \*MERGEFORMAT}
{MERGEFIELD COUNTRY \*MERGEFORMAT}
{MERGEFIELD POSTCODE \*MERGEFORMAT}




Fields:

Send_To
Client_Name
AddressDetail
City
County
Country
PostCode
  #2   Report Post  
Posted to microsoft.public.word.programming,microsoft.public.word.newusers,microsoft.public.word.pagelayout
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default How do you suppress blank Address lines during a Word merge?

Word's ability to suppress blank lines in a mail merge of this type
unfortunately goes out the window if you use line breaks instead of
paragraph breaks, but you can get around it with IF fields.

For COUNTY, for example, you use this field:

{ IF { MERGEFIELD COUNTY } = "" "" "{ MERGEFIELD COUNTY }
" }

Note the line break after the second merge field and before the closing
quote. This makes the line break part of the FalseText. The result will be
that if the COUNTY field is blank (""), then nothing will be inserted; if it
is not blank, the contents will be printed, followed by a line break. So
your whole address block will look like this (MERGEFORMAT switches omitted
to prevent wrapping errors in this text format):

{ MERGEFIELD SEND_TO }
{ MERGEFIELD CLIENT_NAME }
{ MERGEFIELD ADDRESSDETAIL }
{ MERGEFIELD CITY }
{ IF { MERGEFIELD COUNTY } = "" "" "{ MERGEFIELD COUNTY }
" }{ IF { MERGEFIELD COUNTRY } = "" "" "{ MERGEFIELD COUNTRY }
" }{ MERGEFIELD POSTCODE }

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

"eggedd2k" wrote in message
...
I'm having some problems getting the address part of the data source
to display correctly. I'm merging from an SQL data source/query.

In particular the County and Country parts are showing as blank lines
if the corresponding field is empty. Some
clients in our database do not have anything in the County or Country
fields and therefore I need these fields to
supress if they are blank - and instead display the PostCode line
instead - rather than showing as a blank line.

The fields codes are shown as below.

Can anyone show me how I need to format the County and Country fields
so that they don't display if they are empty BUT ensure that they
don't leave blank lines?

thanks very much

Field Codes:

{MERGEFIELD SEND_TO \*MERGEFORMAT}
{MERGEFIELD CLIENT_NAME \*MERGEFORMAT}
{MERGEFIELD ADDRESSDETAIL \*MERGEFORMAT}
{MERGEFIELD CITY \*MERGEFORMAT}
{MERGEFIELD COUNTY \*MERGEFORMAT}
{MERGEFIELD COUNTRY \*MERGEFORMAT}
{MERGEFIELD POSTCODE \*MERGEFORMAT}




Fields:

Send_To
Client_Name
AddressDetail
City
County
Country
PostCode


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Suppress Blank Lines in Address (Word 2000-2003) Wobbs Mailmerge 2 February 25th 08 04:03 PM
Word 2007 Address Block and Suppress Blank Lines JohnH Mailmerge 9 December 14th 07 12:15 PM
How do you suppress blank lines when merging address labels? Jan Admin Suprv Mailmerge 2 August 29th 07 07:57 AM
How do I suppress blank address lines in Word2003 mail merge? JonUK5691 Mailmerge 1 March 22nd 05 09:31 PM
In Word 2002, how do I suppress blank lines in an address? geller Mailmerge 1 February 2nd 05 05:50 AM


All times are GMT +1. The time now is 06:59 AM.

Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright 2004-2023 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"