Re: Truncating in Mail Merge

Tech-Archive recommends: Fix windows errors by optimizing your registry



<<
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

.



Relevant Pages

  • Re: Excel Services error and Kerberos
    ... the same account towards SSAS will be used whatever ... I got it work with SSO! ... (SharedServices running Excel Services) ... In the group "Security Configuration" click at the link "Manage settings ...
    (microsoft.public.sharepoint.portalserver)
  • Re: Accounting Reports in Access
    ... this was an Excel sheet. ... This is linked to the main information table using the account number ... you could build a report that groups by teach organization. ... I would then build a sub report that sums up all of the payments made by ...
    (microsoft.public.access.reports)
  • RE: Slow file access
    ... This issue does appear to be isolate to the one account. ... Other Excel and other file types seem to be okay. ... The problem occurs no matter which PC this user logs onto. ... > Microsoft CSS Online Newsgroup Support ...
    (microsoft.public.windows.server.sbs)
  • Retrieve User Attributes (DisplayName & Description)
    ... some User Account attributes, if the User Account does in fact exist (E.g. ... Dim strTo, strRaceNo, strName, strSurname, strEMailAddress, strTPT_From, ... ' Open the Spreadsheet ... ' Bind to Excel object. ...
    (microsoft.public.scripting.vbscript)
  • Re: Prevent Duplicate Records
    ... You can't use that method anywhere else but Excel 2007, ... I enter the same account number it will not let me. ... Else Col L of exsisting record is empty then clear current cell A ... Private Sub Worksheet_Change ...
    (microsoft.public.excel.misc)