Community
Showing results for 
Search instead for 
Do you mean 
Reply

VBA Macro and Mail Merge

New Member
Posts: 3
Country: Switzerland

VBA Macro and Mail Merge

Hi,

 

i've build a Microsoft Word marco implemented in VBA and execute this macro with the help of the Document_New and Document_Open Sub. The problem is that the marco depends on Document Variables set by Act (for example I want to process the "Jobtitle" by executing ActiveDocument.Variables("[ACTFIELD]TBL_CONTACT.JOBTITLE")) seem not to be available at this time. All Variables contain only the descriptor (like "<Title>"). Executing the macro after the Document is loaded completely works fine.

First, I tried to set a timer in Document_Open, but Act waits for this timer (the "Mail Merge" progress bar is displayed). Is there any other method to execute my macro? I am sure that I am not the first with this problem, but I was unable to find a "automatic" solution.

 

Kind regards,

Jan

New Member
Posts: 3
Country: Switzerland

Re: VBA Macro and Mail Merge

Does really nobody use Microsoft Macros within their templates?
Platinum Elite Contributor
Posts: 14,384
Country: Australia

Re: VBA Macro and Mail Merge

What do you want the macro to do?

Remember the merge uses code that probably avoids other macros to ensure it works.

 

 

If you're trying to do Conditional If/Then type stuff, maybe this will help:

http://blog.glcomputing.com.au/2009/04/using-conditional-controls-in-act.html