Re: Truncating in Mail Merge
- From: "Peter Jamieson" <pjj@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 4 Jun 2007 16:30:00 +0100
<<
It seems like it should be
just as simple as the RIGHT function in Excel
It does, but unfortunately it isn't.
If the account number is a whole number (or in some case, contains a whole number) not more than around 14 or so digits long, you can use
{ =mod({ MERGEFIELD youraccountfield },10000) } and prefix any asterixes you need.
All the {} need to be the special field code braces that you can insert using ctrl-F9.
If the account number is more complex there are two things you can do other than transform your data source into another format:
a. use a DATABASE field - nasty, but see http://tips.pjmsn.me.uk/t0004.htm
b. use Word VBA to issue a SQL query to get the data from the .csv file, and put the necessary right() function in that query. That isn't straightforward either, but it can usually be done as long as the .csv can be read by the Jet ODBC driver/OLE DB provider and doesn't have more than 255 fields.
Peter Jamieson
"Laurel" <Laurel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:5DF29172-C6F5-4205-85C6-EEF2D7FB78EE@xxxxxxxxxxxxxxxx
Hi All,
I'd like to print just the last 4 numbers of an account number in a mail
merge letter (front fill the rest with asterisks). It seems like it should be
just as simple as the RIGHT function in Excel but by necessity my source
document has be a CSV text document so the function has to take place in
Word. Is this possible?
Thanks so much!
Laurel
.
- Prev by Date: Re: Truncating in Mail Merge
- Next by Date: Re: Listing the merge variables from all the dot documents
- Previous by thread: Re: Truncating in Mail Merge
- Next by thread: Re: Truncating in Mail Merge
- Index(es):
Relevant Pages
|