CommandBar.Type Property (Office)

Gets the type of command bar. Read-only.


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."


expression. Type

expression Required. A variable that represents a 'CommandBar' object.


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.

Set oldCtrl = CommandBars("Custom").Controls(1) 
If oldCtrl.Type = msoControlButton Then 
    Set newCtrl = CommandBars.FindControl(Type:= _ 
        MsoControlButton, ID:= _ 
End If

See also

CommandBar Object

CommandBar Object Members