Hi Clarkie,
> I have a userform with vba macro's in it, but when I
> perform a mail merge and save the results as a new
> document, the macro's have been lost.
>
> Is there any way round this ?
Use a macro to execute the mailmerge to a new document.
After the .execute command, put in a code line to attach
the template to the document. Roughly:
ActiveDocument.AttachedTemplate = "the path"
or, pick it up from the main merge document
Dim mergeDoc as Word.Document
Set mergeDoc = ActiveDocument
mergeDoc.MailMerge.Execute
ActiveDocument.AttachedTemplate =
mergeDoc.AttachedTemplate
(Note: all off the top of my head, so there may be sytax
errors in there. But that's the basic way you have to go.)
Since Word97 or so, mail merge does attach the merge result
doc to the same template as the main merge document. But
somehow the link back to the template is incomplete. so you
need to force the link.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)