View Single Post
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Lee McArthur Lee McArthur is offline
external usenet poster
 
Posts: 3
Default Is it possible to insert a line break into a mergefield?

I'm trying to supress blank mergefields in an address with the
following fields:

Add1
Add2
Add3
Add4
City
State
Postcode

This information is dragged from an SQL Database and uses the
following code:

{ MERGEFIELD "ADD1" SLXMergeField source="SLXSPECIAL"
name="SLXSPECIAL_SQL" calculated="false" formatType="0"
formatString="" version="6.2"ParametersParameter name="SQL"!
[CDATA[SELECT ADDRESS.ADDRESS1 FROM ACCOUNT INNER JOIN ADDRESS ON
ACCOUNT.ADDRESSID = ADDRESS.ADDRESSIF WHERE (ACCOUNT.ACCOUNTID
= :AccountID)]]/Parameter/Parameters/SLXMergeField }

The Data merges fine and isn't an issue. However I can't for the life
of me get the fields to suppress! I've followed quite a few
suggestions from other problems on here, such as different kinds of IF
statements. I've used bookmarks too but can't get rid of the blank
lines created when no data is available.

What I'm wondering is, is it possible to insert a new line through a
fieldcode? I reckon that would work. Add1 is a bookmark that contains
the Address Line 1 data:

{ IF { Add1 } "" "{ Add1} /n" }{ IF { Add2 } "" "{ Add2} /n" }
Where /n would be a new line.... for example.

Maybe I'm missing something obvious? SQL code just doesn't want to
suppress

Any help would be much appreciated.

Thanks in advance.

ps. Just pressing the return key within the mergefield doesn't work,
I've tried that too!