Table of contents
TOC
Collapse the table of content
Expand the table of content

CommandBars.Add Method (Office)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Creates a new command bar and adds it to the collection of command bars.

Note The use of CommandBars in some Microsoft Office applications has been superseded by the new ribbon component of the Microsoft Office Fluent user interface. For more information, search Help for the keyword "ribbon."

Syntax

expression. Add( Name, Position, MenuBar, Temporary )

expression Required. A variable that represents a CommandBars object.

Parameters

NameRequired/OptionalData TypeDescription
NameOptionalVariantThe name of the new command bar. If this argument is omitted, a default name is assigned to the command bar (such as Custom 1).
PositionOptionalVariantThe position or type of the new command bar. Can be one of the MsoBarPosition constants.
MenuBarOptionalVariantTrue to replace the active menu bar with the new command bar. The default value is False.
TemporaryOptionalVariantTrue to make the new command bar temporary. Command bars are deleted when the container application is closed. The default value is False.

See also

Concepts

CommandBars Object

Other resources

CommandBars Object Members

© 2017 Microsoft