#1
|
||||
|
||||
Mail Merge Events
From some googling I've found that there's a bit of a problem when using the MailMergeAfterMerge event and MailMergeBeforeMerge event in that they don't trigger if you start the merge from the toolbar icon.
I was just wondering if anyone ever found a way around this issue, so the events fire at the start/end of a merge however it's started? Thanks |
#2
|
|||
|
|||
Did you try to put the sub in ThisDocument code windows instead of in a module?
Give a try. Also provide your code here so someone can help. |
#3
|
||||
|
||||
Thanks for your response.
I'm aiming to use this for any document, so I can't really put it in the ThisDocument code. I did try it anyway, but it still didn't fire there either. There's not really any code at the moment, I'm just trying to see if I can get anything to trigger before going further, so for now it's just: Code:
Private Sub app_MailMergeBeforeMerge(ByVal Doc As Document, ByVal StartRecord As Long, ByVal EndRecord As Long, Cancel As Boolean) MsgBox "Merge has started." End Sub Code:
Public WithEvents app As Word.Application |
#4
|
||||
|
||||
You really would'nt want to do that; that's a sure way of guaranteeing the MailMergeAfterMerge macro won't work. Event macros of this kind must be used in a properly initiated Class module.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
||||
|
||||
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
||||
|
||||
Doh!
I didn't realise that would be necessary - works fine for me too now. Many thanks for your time. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I mail merge records into table columns with more than one merge field? | tech123 | Mail Merge | 1 | 04-26-2017 07:13 PM |
Mail Merge is Deleting objects in my header and footer during the merge | bgranzow | Mail Merge | 9 | 06-05-2015 05:03 AM |
Mail merge how to link mail merge field value to a column heading | dsummers | Mail Merge | 1 | 05-08-2014 02:59 PM |
Mail Merge Duplication of address on merge | RICKY | Mail Merge | 1 | 09-26-2012 03:14 PM |
Saving INDV mail merges During the mail merge | sedain121 | Mail Merge | 2 | 10-04-2011 07:52 PM |