Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / June 2007

Tip: Looking for answers? Try searching our database.

Mailmerge: remove blank lines created by carriage return in datas.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SteveM - 26 Jun 2007 12:43 GMT
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?
SteveM - 26 Jun 2007 14:41 GMT
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
Peter Jamieson - 26 Jun 2007 18:02 GMT
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
> To explain further:
>
[quoted text clipped - 11 lines]
>
> Steve
SteveM - 26 Jun 2007 18:16 GMT
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

> 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
[quoted text clipped - 23 lines]
> >
> > Steve
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.