DisableAutoMacros [Disable]
Disables AutoOpen, AutoClose, AutoNew, and AutoExit macros until they are
re-enabled with the instruction DisableAutoMacros 0 or until Word is started
again. You can place a DisableAutoMacros statement before the line in your
macro that triggers an auto macro --- for example, a FileNew instruction
that creates a document based on a template containing an AutoNew macro.
Argument Explanation
Disable Specifies whether to disable auto macros:0 (zero) Enables auto
macros1 or omitted Disables auto macros
You cannot use DisableAutoMacros to disable an AutoExec macro or to disable
the current macro. For example, you could not place a DisableAutoMacros
statement in an AutoOpen macro to disable AutoOpen. To disable an AutoExec
macro, hold down the SHIFT key while Word is loading or use the /m startup
switch. For more information, see Startup Switches.
Heres a macro for turning it on and off. There is no way I know of to tell
if automacros are enabled or not, and I've looked.
Public Sub MAIN()
Dim Cmd
WordBasic.DisableInput
Rem WordBasic.MsgBox WordBasic.[MacroDesc$]("EnableAutoMacro"), -8
Rem Above line print description to status bar kills the macro without
error?????
WordBasic.ScreenUpdating
WordBasic.WaitCursor 1
Dim Dlg As Object
WordBasic.BeginDialog 286, 102, "Auto Macros"
WordBasic.PushButton 192, 54, 88, 21, "&Close", "Push4"
WordBasic.PushButton 192, 6, 88, 21, "&Enable", "Push1"
WordBasic.PushButton 192, 30, 88, 21, "&Disable", "Push2"
WordBasic.Text 10, 6, 176, 78, "To enable or disable auto Macros for the
current session of Word." + Chr(10) + "Choosing Close closes the box without
making any changes.", "Text1"
WordBasic.Text 10, 82, 167, 13, "(C) 1996 David Candy", "Text2"
WordBasic.EndDialog
Set Dlg = WordBasic.CurValues.UserDialog
Cmd = WordBasic.Dialog.UserDialog(Dlg, 3)
If Cmd = 3 Then WordBasic.DisableAutoMacros 0
If Cmd = 4 Then WordBasic.DisableAutoMacros 1
End Sub
--
-------------
Regards
David Candy Microsoft MVP Jumpstart (Word)
http://www.angelfire.com/biz/serenitymacros