Customizing Dialog Boxes Menus And Toolbars

EXISTING MENUS AND TOOLBARS (CONTINUED)

PARAMETER

DESCRIPTION

Type

An msoControlType constant value indicating the type of control to add. The five constant values include: msoControlButton for a standard button, msoControlEdit for an edit box, msoControlComboBox for a combo box, msoControlDropdown for a drop-down list, and msoControlPopup for another pop-up list of controls or a menu pop-up.

Id

An integer value specifying the built-in control to add to the command bar. If you omit this parameter, or specify a value of 1, Excel adds a blank control.

Parameter

Built-in controls use this parameter to pass information to Excel for running the command.

Before

An integer value specifying the position for the new control. You place the control before the specify control position. If you omit this parameter, Excel adds the control at the end of the command bar.

Temporary

Contains a Boolean value indicating whether the control is temporary. If the value of this parameter is True, the control is removed when Excel closes.

NEW MENUS AND TOOLBARS

You can create new menus and toolbars as a means of When you utilize the Add method, Excel creates a new customizing Excel. To create a new menu or toolbar blank CommandBar. You can also use any of the optional from a procedure, you must add a new CommandBar parameters associated with the Add method to specify object to the CommandBars collection. You accomplish the settings for the command bar as you create it. The this with the Add method associated with the following table describes each of the four parameters

CommandBars collection with the code: that you can call with the Add method. See the sections

CommandBars.Add. "Create a Custom Toolbar" and "Create a Custom Menu"

for more information on creating toolbars and menus.

PARAMETER

DESCRIPTION

Name

Indicates the assigned name of the new command bar. If you omit this parameter, Excel assigns a default name of Custom 1 to the command bar. The number Excel associates with the name increments as you add more command bars.

Position

Determines the position and type of the command bar. You can specify any one of the

MsoBarPosition constant values. Use msoBarLeft, msoBarTop, msoBarRight, or msoBarBottom to dock the toolbar at a specific location on the screen. Use msoBarFloating to create a floating toolbar or msoBarPopup to create a shortcut menu.

MenuBar

Contains a Boolean value, which indicates whether to replace the currently active menu bar with the new command bar. Typically the default value of False works best for this parameter. Specify a value of True to replace the active menu bar.

Temporary

Contains a Boolean value, which indicates whether the command bar is temporary. If the value of this parameter is True, Excel removes the toolbar when Excel closes.

0 0

Post a comment