Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.word.programming,microsoft.public.word.newusers,microsoft.public.word.pagelayout
|
|||
|
|||
![]()
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 |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Suppress Blank Lines in Address (Word 2000-2003) | Mailmerge | |||
Word 2007 Address Block and Suppress Blank Lines | Mailmerge | |||
How do you suppress blank lines when merging address labels? | Mailmerge | |||
How do I suppress blank address lines in Word2003 mail merge? | Mailmerge | |||
In Word 2002, how do I suppress blank lines in an address? | Mailmerge |