Thread: Trim text
View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default Trim text

There's no way using Word fields.

You can consider:
a. using a view/query in your database to strip off the text you don't
want, then using that as the data source. If you're not in a position to do
that, you could try...
b. using MSQuery to set up the connection to your database (this requires a
suitable ODBC DSN to be on all the user machines. In Word 2002/3, MS Query -
if installed - can be accessed via the Tools menu at the top right of the
Select Data Source dialog box). IN Word 2000/97, there's a button in the
Open Data Source dialog box. MS Query really just creates a query that Word
then uses to open the data source directly. Unfortunately, it doesn't always
get it right and you can find that everything appears to go well until you
attempt the merge. In that case you could try...
c. using Word VBA to call OpenDataSource to issue a SQL query to your
database. I can provide more info. if you are interested, or you may be able
to find my previous articles on this using Google Groups
d. using Word VBA events to extract the necessary string and insert it in
the Mail Merge Main document, once for each record in the data source.
e. "marking" these fields in some way, e.g. putting @@@ in front of each
course name, merging programmatically to a new document, the using
find/replace to strip out the @@@...: strings

Peter Jamieson



"Miriam C." wrote in message
news
HI,

I created a MS Word mail merge from an applicaiton (runs on a SQL backend)
to print training certificates.

The course name in the database contains a code infront of the name i.e.
BA10:Novell Networking Foundations. Is there a way to remove the BA10:
portion of the course name so that it only displays Novell Networking
Foundation. I would rather do that then prompting the users to enter
course
names with typos...

Many thanks in advance
Miriam