How to bypass the autoexec macros?
Hi all,
I am using MS office 2003. Whenever I open a word some startup templates will load automatically. If I open a new or existing word document some macros from that template will run automatically.
My problem is I want to open certain documents without running startup macros. How can I achieve that through vba code?
Thanks,
CS.
Re: How to bypass the autoexec macros?
Are you trying to open the documents via code or asking how to disable that via code?
Re: How to bypass the autoexec macros?
I want to open a document via code and don't want to run startup macro for that document alone.
Re: How to bypass the autoexec macros?
Ok, I believe there is a command or parameter for this. Let me see.
Re: How to bypass the autoexec macros?
Looks like this may help.
VB Code:
WordBasic.DisableAutoMacros 1
For more info...
http://msdn.microsoft.com/library/de...HV05209939.asp
Re: How to bypass the autoexec macros?
Thanks Rob! But, Sometimes it is not working. I don't know why?
Anyway, to enable the startup macro again we need to use the following code:
VB Code:
WordBasic.DisableAutoMacros 0
Re: How to bypass the autoexec macros?
Not sure why it wouldnt work every time but is it close enough?
Re: How to bypass the autoexec macros?
simple solution - hold down the left shift key on open
Re: How to bypass the autoexec macros?
Perhaps, but onyl if its not disabled as that is also a known manual method of bypassing it. :)