Forum Discussion
Using Mail Merge with MACROS
Can you respond with the code that you have in the macro so that we can make some appropriate suggestions.
Hi Doug
Thanks for your reply.
It is a very basic Macro that runs through a table and on certain # prefixed monikers in the 1st cell triggers the generation of certain formatted headers or footers (and a blank line)
When I was informed that the merge would combine different pages together I wondered if new Tables would have been added on subsequent pages , so I tried changing the Table index on an inner loop going through the number of pages in the document on the outer loop. But the Macro did not recognize any additional Tables. I tried a string search to the #monikers, but only the monikers on the first page were processed.
I tried a Macro record of the Merge page forward operation. But this only worked for the interactive Macro. When I tried the mail merge posting for real the Macro crashed. I am not an adept with VBA Macro in WORD I have always used EXCEL in the past.
The above is the start of the macro, where it clears any previous subtitles generated
It carries on processing through Table 1 doing substitutions like a cascading style sheet
And it ends further down with a default catchall section before it ends
Very simple, works perfectly on the first page. And leaves subsequent pages alone.
I am sure it is something straightforward to solve for people who know how the merge document can be addressed once it is constructed over several pages.
Thank you for taking a look.