DisableAutoMacros Disables Only AutoExec from Command Line

Last reviewed: August 4, 1997
Article ID: Q117399
The information in this article applies to:
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Windows operating system version 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:

   ARTICLE-ID: Q70991
   TITLE     : Auto Macros in Word

REFERENCES

"Microsoft Word Developer's Kit," version 6.0, page 339

Kbcategory: kbusage kbmacro KBSubcategory:


Additional reference words: 6.0 6.0a 6.0c disableautomacros automatic
macros autonew autoopen autoclose autoexit autoexec doesn't docerr doc err
word6 documentation error wdk winword
Version : 6.0 6.0a 6.0c
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 4, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.