MacroOptions Method

Applies To

Application Object.

Description

Corresponds to options in the Macro Options dialog box.

Syntax

object.MacroOptions(macro, description, hasMenu, menuText, hasShortcutKey, shortcutKey, category, statusBar, helpContextID, helpFile)

object

Required. The Application object.

macro

Required. The name of the macro to set options for, as a string.

description

Optional. The description of the macro, as a string.

hasMenu

Optional. If True, then a menu item is automatically added to the Tools menu for this macro. If True, then menuText must also be specified. If False or omitted, no menu item is added for the macro. If the macro already has a menu item created for it, setting this argument to False will remove the menu item.

menuText

Required if hasMenu is True; ignored otherwise. The text of the menu item, as a string.

hasShortcutKey

Optional. If True, a shortcut key is assigned to the macro. If True, then shortcutKey must also be specified. If False or omitted, no shortcut key is assigned to the macro. If the macro already has a shortcut key, setting this argument to False will remove the shortcut key.

shortcutKey

Required if hasShortcutKey is True; ignored otherwise. The shortcut key (first character only) as a string.

category

Optional. The function category (Financial, Date & Time, User Defined, and so on) that the macro appears in, as an integer.

statusBar

Optional. The status bar text for the macro, as a string.

helpContextId

Optional. The context ID for the Help topic assigned to the macro, as an integer. The context ID also applies to any menu items and/or toolbar buttons assigned to the macro.

helpFile

Optional. The name of the Help file that contains the Help topic defined by helpContextId, as a string.