#1
|
|||
|
|||
run aVBA Macro
I have a document in which I have also a VBA Macro defined.
How can I get it to run automatically when a user does a Mail Merge? |
#2
|
||||
|
||||
You might start by taking a look at:
https://www.msofficeforums.com/137121-post2.html https://www.msofficeforums.com/170431-post6.html https://www.msofficeforums.com/151721-post27.html https://www.msofficeforums.com/100294-post17.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thank you but I don't think i was clear what the issue is.
My external program starts a mail merge using Word. When I was trying to do was to insert a code to change the formatting in the created document before it closes the merger routine. I have written the code - it's how I get it to run on the created document that's the problem. If I can make it the last thing that happens before it closes the mail merger that would be great |
#4
|
||||
|
||||
You can name a macro to get it to run with an event that you know has to happen after your merge. An example is the Document_Close event
See Document.Close event (Word) | Microsoft Learn
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to Remove Paras with Line Spac 6; Macro to Convert Paragraphs to Outline Numbered | venganewt | Word VBA | 0 | 01-25-2022 06:28 PM |
Footnote extraction macro [Why is this macro so slow? / anyway to make it faster?] | Le_Blanc | Word VBA | 10 | 03-22-2021 11:38 AM |
Spell check macro within macro button field doesn't work in one document | samuelle | Word VBA | 0 | 07-20-2016 02:27 AM |
Macro Question: Need help making a macro to highlight the first word in every sentence | LadyAna | Word | 1 | 12-06-2014 10:39 PM |
custom icon, undo/redo for macro, permanent macro | Rapier | Excel | 0 | 08-05-2013 06:30 AM |