Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
SteveM SteveM is offline
external usenet poster
 
Posts: 7
Default Mailmerge: remove blank lines created by carriage return in datas.

I want to print some mailing labels but I have blank lines in the address
fields that are created from carriage returns in the datasource.

How do I stop these blank lines displaying on my labels?
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
SteveM SteveM is offline
external usenet poster
 
Posts: 7
Default Mailmerge: remove blank lines created by carriage return in datas.

To explain further:

The fields from my datasource (an Excel file) are Address, Town, County etc.
The Address field is multiline and some users have added a carriage return
at the end of the street address info causing a blank line between
Address/Town.

So, I need to trim off this character from the end of the data in this field
if it is there.

Any ideas?

Steve
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mailmerge: remove blank lines created by carriage return in datas.

Your best best is probably to create an Excel macro that fixes the data
before the merge. (You'd probably be better off asking about that in an
Excel group, too). However, you /might/ be able to do this in Word by
opening the data source from within Word VBA and using an SQL function that
replaces two CR (or CRLF, or whatever it actually is) characters by a single
one. I don't know in this case whether that is workable, but if you want to
go that route and can't figure out the VBA or the necessary SQL, ask again
and I'll have a closer look. Also, that approach own't work if for other
reasons you have to open the worksheet using DDE (the default in Word 2000
and earlier).

Peter Jamieson
"SteveM" wrote in message
...
To explain further:

The fields from my datasource (an Excel file) are Address, Town, County
etc.
The Address field is multiline and some users have added a carriage return
at the end of the street address info causing a blank line between
Address/Town.

So, I need to trim off this character from the end of the data in this
field
if it is there.

Any ideas?

Steve


  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
SteveM SteveM is offline
external usenet poster
 
Posts: 7
Default Mailmerge: remove blank lines created by carriage return in da

Thanks for the reply Peter.

The Excel worksheet was created from a query in Access. I solved the problem
by modifying the query to detect Chr(13) & Chr(10) at the end of the data and
return only the data portion of the field prior to their occurrence.

Steve

"Peter Jamieson" wrote:

Your best best is probably to create an Excel macro that fixes the data
before the merge. (You'd probably be better off asking about that in an
Excel group, too). However, you /might/ be able to do this in Word by
opening the data source from within Word VBA and using an SQL function that
replaces two CR (or CRLF, or whatever it actually is) characters by a single
one. I don't know in this case whether that is workable, but if you want to
go that route and can't figure out the VBA or the necessary SQL, ask again
and I'll have a closer look. Also, that approach own't work if for other
reasons you have to open the worksheet using DDE (the default in Word 2000
and earlier).

Peter Jamieson
"SteveM" wrote in message
...
To explain further:

The fields from my datasource (an Excel file) are Address, Town, County
etc.
The Address field is multiline and some users have added a carriage return
at the end of the street address info causing a blank line between
Address/Town.

So, I need to trim off this character from the end of the data in this
field
if it is there.

Any ideas?

Steve



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
Search and replace hard-line-return character, not carriage return Tyler T Microsoft Word Help 2 August 16th 06 09:11 PM
Lines in 4 corners of New> "Blank document" ...how to remove? jackz Microsoft Word Help 4 October 14th 05 05:25 PM
remove the blank lines TUB Microsoft Word Help 7 August 3rd 05 08:30 PM
Blank lines in Label MailMerge CCC Mailmerge 2 July 7th 05 05:14 AM
How do I remove the blank line on pressing the return key in word. spats Tables 4 March 29th 05 07:42 AM


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

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"