PDA

View Full Version : Running a macro upon mail merge



Stobby256
05-11-2010, 02:44 AM
Hi All,

I have a peculiar application that mail merges student progress records to WORD (2007). So far so good. However I want to perform a calculation on some of that data via VBA, ( I usually do it in Excel so I'm OK with VBA).

Now, when I merge the document from my application I would like that particular macro to run before its printed :doh:

How?

Thanks in advance

Steve

TonyJollans
05-11-2010, 04:29 AM
I don't mean to trivialise things but I don't understand what you are unable to do. What is the difficulty with ...

Run the merge.
Run the macro.
Print the document.

Stobby256
05-11-2010, 05:16 AM
Honestly, you guys have to simplfy things :)

Yep point taken - how can I run that macro automatically after the merge is completed?

Tinbendr
05-11-2010, 06:04 AM
To run it from Excel, try this. (http://www.vbaexpress.com/forum/showpost.php?p=213531&postcount=15)

TonyJollans
05-11-2010, 07:32 AM
I assume you are not running the merge from code, so you should probably look at the Application MailMergeAfterMerge Event.