Microsoft KB Archive/117399

{|
 * width="100%"|

DisableAutoMacros Disables Only AutoExec from Command Line

 * }

Q117399

-

The information in this article applies to:


 * Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
 * Microsoft Windows 3.1

-

SUMMARY
The "Microsoft Word Developer's Kit, First Edition" incorrectly states on page 339 that:

    "You can use the following command line to disable all     auto macros, including AutoExec:

winword.exe /mDisableAutoMacros" This above incorrect information also appears in WordBasic Help.

When executed from the command line, the DisableAutoMacros instruction disables ONLY the AutoExec macro but does not disable the AutoNew, AutoOpen, AutoClose, or AutoExit macros.

WORKAROUND
WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

To disable all auto macros for the current session of Word, the DisableAutoMacros command must be issued from inside a macro. Use the following macro to accomplish this:

    Sub Main DisableAutoMacros End Sub If you name this macro "DisableAuto" (without the quotation marks), you can use the command line "WINWORD.EXE /mDisableAuto" (without the quotation marks) to disable all auto macros, including the AutoExec macro, for the entire Word session.

To modify the command line, in Program Manager, select the Word for Windows icon. From the File menu, choose Properties. Make your changes to the command line and choose OK.

For additional information, please see the following article(s) in the Microsoft Knowledge Base:

"Q70991 Auto Macros in Word"