
Signature
When I execute "openMedHistory" and the line
Word.Documents.Add Template:="G:\ZZZdoc\(ALL)MRPMedHist.dot", Visible:=False
will be executed it displays the UserForms for this newly added document.
How can I suppress this macro for the newly added Documents from being
invoked/executed? Or basically I don't want the the UserForm for this newly
added document to be displayed. Anybody can help how can I suppress this
macro?
Jeff B Paarsa
Hi =?Utf-8?B?SmVmZmVyeSBCIFBhYXJzYQ==?=,
> When I execute "openMedHistory" and the line
> Word.Documents.Add Template:="G:\ZZZdoc\(ALL)MRPMedHist.dot", Visible:=False
[quoted text clipped - 3 lines]
> added document to be displayed. Anybody can help how can I suppress this
> macro?
Do any other macros in this document+template combination have to be available
for execution? Which version of Word?
You can use WordBasic.DisableAutoMacros -1 to turn off execution of Auto macros.
But you do have to remember to set it again to 0 to allow them to execute.
If NO macros need to execute you can set the AutomationSecurity to not allow
macros at all (Word 2002/2003).
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
Jeffery B Paarsa - 21 Sep 2006 17:49 GMT
Hi Cindy,
I am running Word 2003. I used WordBasic.DisableAutoMacros -1 statement
right before I do Word.Documents.Add.... but I get the following:
Run-time error '438'
Object doesn’t support this property or method.
I downloaded the WordBasic and put it inside of the Office11 folder but
still the same.

Signature
Jeff B Paarsa
> Hi =?Utf-8?B?SmVmZmVyeSBCIFBhYXJzYQ==?=,
>
[quoted text clipped - 22 lines]
> This reply is posted in the Newsgroup; please post any follow question or reply
> in the newsgroup and not by e-mail :-)
Cindy M. - 22 Sep 2006 10:21 GMT
Hi =?Utf-8?B?SmVmZmVyeSBCIFBhYXJzYQ==?=,
> I am running Word 2003. I used WordBasic.DisableAutoMacros -1 statement
> right before I do Word.Documents.Add.... but I get the following:
> Run-time error '438'
> Object doesnât support this property or method.
Ah, my mistake. It's a 1, not -1. See
http://word.mvps.org/faqs/macrosvba/WordBasicCommands.htm
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Jeffery B Paarsa - 21 Sep 2006 17:54 GMT
Sorry I forgot to answer "Do any other macros in this document+template
combination have to be available for execution?"
Answer is No.

Signature
Jeff B Paarsa
> Hi =?Utf-8?B?SmVmZmVyeSBCIFBhYXJzYQ==?=,
>
[quoted text clipped - 22 lines]
> This reply is posted in the Newsgroup; please post any follow question or reply
> in the newsgroup and not by e-mail :-)