Style Property

Microsoft Office Visual Basic

ShowStyle property as it applies to the CommandBarButton object.

Returns or sets the way a command bar button control is displayed. Read/write MsoButtonStyle.

MsoButtonStyle can be one of these MsoButtonStyle constants.
msoButtonAutomatic
msoButtonCaption
msoButtonIcon
msoButtonIconAndCaption
msoButtonIconAndCaptionBelow
msoButtonIconAndWrapCaption
msoButtonIconAndWrapCaptionBelow
msoButtonWrapCaption

ShowStyle property as it applies to the CommandBarComboBox object.

Returns or sets the way a command bar combo box control is displayed. Can be either of the following MsoComboStyle constants: msoComboLabel or msoComboNormal. Read/write MsoComboStyle.

MsoComboStyle can be one of these MsoComboStyle constants.
msoComboLabel
msoComboNormal

Example

This example creates a shortcut menu containing a button control and a combo box control and sets the style of each.

Set myBar = CommandBars _
    .Add(Name:="Custom1", Position:=msoBarPopup, Temporary:=False)
With myBar
    .Controls.Add Type:=msoControlButton, Id:=3
    .Controls(1).Style = msoButtonCaption
    .Controls.Add Type:=msoControlComboBox
    With .Controls(2)
        .Style = msoComboLabel
        .AddItem "vanilla"
        .AddItem "chocolate"
        .AddItem "cookie dough"
    End With
End With
myBar.ShowPopup