![]() |
|
#1
|
|||
|
|||
![]()
Hi all,
Microsoft Word - Mail merge / VBA question I have set up a document to perform mail merge, which works fine. However once I run the mail merge the VBA code that I have built into the document doesn't transfer across into the new document prepared by the mail merge. Does anyone have any ideas if this can be done? To give you more information the VBA code works fine in the original document, but after performing mail merge the code is not in the module of the new document. I have tried adding this to my normal document module and it worked on the new document produced by mail merge, however I need this to be available to other people and so need a solution built into the document. Don't know if its possible to have a code that copies the current code into the normal module or if there is a better way to do this? Thanks for your help in advance! |
#2
|
||||
|
||||
![]()
That is to be expected. Your code should be stored in the template your mailmerge main document is based on. That way, the code will be available to both the mailmerge main document and any output documents you produce from it.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Hi Paul,
Thanks for the response. By based on the template do you mean the normal template? I have tried this but then if colleagues open it on their computer this doesn't work. I have made the VBA starting with "Private Sub Document" is this the issue? thanks, |
#4
|
||||
|
||||
![]()
In that case, you should create a suitable template and save it in a location your colleagues do have access to, then attach that template to your mailmerge main document.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
etcib | Excel Programming | 3 | 04-23-2018 02:23 PM |
![]() |
Andrewwill | Mail Merge | 6 | 01-06-2018 10:25 PM |
![]() |
mihnea96 | Excel Programming | 2 | 08-15-2017 04:57 AM |
Macro to loop through all cells in a table produced by a mail merge | elh52 | Word VBA | 4 | 08-31-2014 10:50 PM |
Mail merge Field Code Manipulation | macjnr | Mail Merge | 0 | 09-10-2009 11:37 AM |