Add (Items)

This method adds a menu bar Item object to the Items collection of a CommandBar control.

Syntax

items.Add([index], [key], [caption], [style])

Parameters

items
Required. Name of a Items collection.
index
Optional. Location to store the Item object in the Items collection.
key
Optional. Unique string expression that can be used to access a member of the Items collection.
caption
Optional. Title for the Item object added to the menu bar.
style
Optional. Value that determines whether the Item object acts as a separator on a menu.

Return Value

Reference to the new Item object.

Remarks

The following table shows the possible values for the style parameter.

Constant
Value
Description
cbrMenuDefault 0 Default. Item is added as a normal menu command.
cbrMenuSeparator 1 Item is added as a menu separator.