Detecting a mailmerge

P

Paul Simpson

Hi,

I need to execute some code when a user performs a
mailmerge (regardless of whether it's to a new document
or to the printer).

Can you advise what subroutine I need to define to hold
my code?

Many thanks,

Paul Simpson
IT Manager
ST Paul's Girls' School
 
C

Cindy Meister -WordMVP-

Hi Paul,
I need to execute some code when a user performs a
mailmerge (regardless of whether it's to a new document
or to the printer).

Can you advise what subroutine I need to define to hold
my code?
Depends very much on the version of Word we're discussing?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
P

Paul Simpson

Sorry!

We use OfficeXP (so I think that's Word 2002?)

The situation is that I am setting up the mailmerge using
a template. The user sets up some parameters in a dialog
box first. They can then edit the document before
performing the merge. What I need to be able to do is to
update the database to indicate that the mailmerge has
been completed for these particular records.

Ideally, I would like to know which records were merged
(in case the user has filtered them down) but I can
accept that that could get very complicated!

Paul
 
C

Cindy M -WordMVP-

Hi Paul,
We use OfficeXP (so I think that's Word 2002?)
Excellent, this makes your job much easier. Word 2002
introduced mail merge EVENTS: MailMergeBeforeMerge,
MailMergeAfterMerge, MailMergeBeforeRecordMerge and
MailMergeAfterRecordMerge. I think this last would be most
appropriate for what you want.

If you search my name on the msdn site you should turn up a
few articles. One of them deals with new VBA functionality
in Word 2002, and should have some sample code for these
events. Plus, I think you'll find articles in the Knowledge
Base.
The situation is that I am setting up the mailmerge using
a template. The user sets up some parameters in a dialog
box first. They can then edit the document before
performing the merge. What I need to be able to do is to
update the database to indicate that the mailmerge has
been completed for these particular records.

Ideally, I would like to know which records were merged
(in case the user has filtered them down) but I can
accept that that could get very complicated!

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top