Reply
 
Thread Tools Display Modes
  #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!

  #2   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 forgot to add, I'm using Word 2003.

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Is it possible to insert a line break into a mergefield?

I would have to check, but I don't think the blank line suppression in Word
works on blank lines that happen to be part of the field data, only on blank
lines that consist of one or more blank fields.

What is probably required here is to suppress the blank lines in the
database itself - if you have no control over what is in it, then there's
not a lot you can do about that unless you can construct the address you
want from individual fields in the database. If you do have control I'd
suggest adding a view/stored procedure/function that does the necessary
stripping.

It looks as if you are using SalesLogix (about which I know nothing) and
that it is either using info. stored in each MERGEFIELD to generate the
necessary queries or is populating the MERGEFIELD fields with data itself
rather than using Word's merge process - if it's the latter, maybe they have
some switch or other than can remove blank lines?

When your data is inserted, does it come in with paragraph marks at the end
of each line, or hard line breaks, cf. the ones you get using
ctrl-shift-enter? If the latter, you might be able to work around using Word
paragraph formatting features.

Peter Jamieson


"Lee McArthur" wrote in message
s.com...
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!



  #4   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?

Peter thanks alot for the very swift response!

What is probably required here is to suppress the blank lines in the
database itself - if you have no control over what is in it, then there's
not a lot you can do about that unless you can construct the address you
want from individual fields in the database. If you do have control I'd
suggest adding a view/stored procedure/function that does the necessary
stripping.


You are correct we are using SalesLogix, however I have severely
limited knowledge/experience of the back end and therefore I am
currently unable to add any procedures or anything at the source.

rather than using Word's merge process - if it's the latter, maybe they have
some switch or other than can remove blank lines?


I will contact the supplier to find out if they have a switch of their
own - thanks.

When your data is inserted, does it come in with paragraph marks at the end
of each line, or hard line breaks, cf. the ones you get using
ctrl-shift-enter? If the latter, you might be able to work around using Word
paragraph formatting features.


When the data is inserted there are no line breaks of any kind, and if
I were to have the fields in a row, data could merge in this way:

AddressLine1CityPostcode

I'm not sure if this will help, but using standard SalesLogix merge
fields the supression works, and the code is as follows:

{ MERGEFIELD "Contact_Address_Address1" SLXMergeField name =
"ADDRESS1 calculated="false" formatType="0" formatString="" Join
type="inner" From table="CONTACT" field="ADDRESSID"/ To
table="ADDRESS" field="ADDRESS"/ /Join/SLXMergeField }

Again, thanks for the help Peter. I'll contact the supplier to see if
they have any answers too!

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
Word should let me insert a conditional line break in a word. Syntactician Microsoft Word Help 5 July 10th 20 04:05 PM
How do I insert a break line across the page jimtmcdaniels Page Layout 5 January 31st 07 11:27 AM
optional line break -break line w/o hyphen; for long method names catherine_techwriter Microsoft Word Help 1 July 19th 06 08:38 PM
How to insert a decorative line break between paragraphs Holly24 Microsoft Word Help 4 January 28th 06 06:20 PM
How to insert mergefield with CTRL F9 Anders S. Willumsen Mailmerge 3 May 30th 05 12:21 AM


All times are GMT +1. The time now is 01:18 PM.

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

About Us

"It's about Microsoft Word"