View Single Post
  #1   Report Post  
Posted to microsoft.public.word.newusers,microsoft.public.word.vba.general
Colonel Blip Colonel Blip is offline
external usenet poster
 
Posts: 12
Default VBA code to execute for a subsequent mail merge

Hello, All!

My outlook 2k3 contact form is the default. The contact names take the form
of Full Name made up of First Name and Last name. First name for a husband
and wife is of the form "Jack & Jill". I need, in a mail merge to be able to
separate this field into two fields if the & exists in the First_Name field.
I was hoping I could do in using Word's IF...Then... Else but I can't.

While I normally create my mailmerge using the OL Tool|Mail Merge wizard,
that is not necessary since I have my document designed and simply need the
data exported. Is there a way with a macro in OL to export Contacts in a
form that would be usable by Word's mailmerge, but as it does so to do the
following:

1. Check the OL First_Name field.
2. If there is a "&" in the field place the second name in the Spouse field
and drop the "&" and following and put the remaining name in the First_Name
field of the merge data file.
3. If there is not a "&" in the First_Name field then do not modify the
field.

I could then reconstruct the couples with the IF statement in Word, but I
would have the couples names in separate fields to be able to use them in
other conditional command I want to use.

Thanks,
Colonel Blip.
E-mail: