Gets the type of command bar. Read-only.

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

Syntax

expression.Type

expression Required. A variable that represents a object.

Example

This example finds the first control on the command bar named "Custom." Using the Type property, the example determines whether the control is a button. If the control is a button, the example copies the face of the Copy button (on the Standard toolbar) and then pastes it onto the control.

Visual Basic for Applications
Set oldCtrl = CommandBars("Custom").Controls(1) If oldCtrl.Type = msoControlButton Then Set newCtrl = CommandBars.FindControl(Type:= _ MsoControlButton, ID:= _ CommandBars("Standard").Controls("Copy").ID) NewCtrl.CopyFace OldCtrl.PasteFace End If

See also: