Gets or sets an item in the CommandBarComboBox control. Read/write.

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.List(Index)

expression A variable that represents a CommandBarComboBox object.

Parameters

Name Required/Optional Data Type Description
Index Required Integer The list item to be set.

Remarks

Note
This property is read-only for built-in combo box controls.

Example
This example checks the fourth list item in the combo box control whose caption is "Stock Data" on the command bar named "Custom." If the item isn't "View News," the example displays a message advising the user that the combo box may be damaged and asks the user to reinstall the application.

Visual Basic for Applications
Set myBar = CommandBars _ .Add(Name:="Custom", Position:=msoBarTop, _ Temporary:=True) With myBar .Controls.Add Type:=msoControlComboBox, ID:=1 .Visible = True End With With CommandBars("Custom").Controls(1) .AddItem "Get Stock Quote", 1 .AddItem "View Chart", 2 .AddItem "View Fundamentals", 3 .AddItem "View News", 4 .Caption = "Stock Data" .DescriptionText = "View Data For Stock" End With If CommandBars("Custom").Controls(1).List(4) _ > "View News" Then MsgBox ("Stock Data appears to be damaged." & _ " Please reinstall application.") End If
check the items listed within a combo box control list list property ofv select items within a command bar combo box control list set the value of a list item in the command bar combo box control

See also: