View Single Post
  #9   Report Post  
Posted to microsoft.public.word.mailmerge.fields
fscodave fscodave is offline
external usenet poster
 
Posts: 11
Default Mailmerge - Firstname truncate to Initial?...

I am a complete tyro, but I did get an answer in a new message I
posted. This was the answer from Cindy Meister:

n the mail merge FAQ on my website you'll find a section on Word
2002/2003, and in there a discussion about using the mail merge events.
There's a sample file that demonstrates basically what you need to do
(manipulate the value of the merge field and put it in the document)

http://homepage.swissonline.ch/cindy...002/MM2002.htm

Cindy Meister

[end of quote]

Basically, you download a zip file after clicking on "mail merge
events" from the page she points you to. The zip file has two files,
both of which have to be unzipped to the same folder. MergeEvents.Doc
is the main document, with some macros inside of it. I don't understand
most of the code, which is in VBA, but I've figured out this much: the
merge points to the other document in the zip file, employees.doc,
which has the field FirstName. The guts of the relevant macro is a
function GetInitial, and the most relevant line is this:

szIntial = Left(doc.MailMerge.DataSource.DataFields("FirstNam e").Value,
1) & "."

[typo with the "intial" instead of "initial" is there, but doesn't
affect the function]

Earlier in the macro the datasource had been defined, I guess, and you
can see that it refers to the "FirstName" field, and takes the leftmost
element of that field and adds a period to it.

However, when I run the merge, I only get the first two records to
merge in the resulting new document. Plus, I don't understand most of
the rest of the macro. I gather that the initial is then put into the
relevant bookmark. So it's possible to do what you asked, I think, but
we'll have to brush up on the VBA to make it work!

David


Mark wrote:
Hi all,

I have a mail merge question, does anyone of you sage beings know how I can
truncate Firstname (MERGEFIELD Lead_PersonFirstname) to its first
initial?

I.e. instead of showing Mark Ryan, showing M Ryan instead?

Many thanks for your help!