Stop AutoOpen macro from running

D

DSUK

Hi, I am having a problem getting Autoopen macros from openeing.

I have a macro in a template that automatically opens documents in a folder,
does some reformatting and saves them, the problem I am having is that some
of the documents have an AutoOpen macro in them that displays a dialog box
and stops everything until you click on OK, I would like to disable the
AutoOpen macro in the documents that are being opened so I can reformat the
enture batch.

I have the following code but it seams to stop the original macro from
running as well as, please can anyone point me in the right direction.

With Application
.AutomationSecurity = msoAutomationSecurityForceDisable
.Documents.Open MyPath + "\" + CurrDoc, False
.AutomationSecurity = msoAutomationSecurityLow
End With

Thanks
David
 
H

Helmut Weber

Hi David,

try:

Wordbasic.DisableAutoMacros

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top