Add Method (ComboItems Collection)

           

Adds a ComboItem object to the collection and returns a reference to the newly created object.

Syntax

object.Add(Index As Variant, Key As Variant, Text As Variant, Image As Variant, SelImage As Variant, Indentation As Variant) As ComboItem

The Add method syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
Index Optional. The position within the collection to create the new object.
Key Optional. A unique string which identifies the item within the collection. May be used in place of Index to designate the object.
Text Optional. The text of the item, as it will appear in the list and text portions of the combo box.
Image Optional. An index or key into an ImageList control that identifies the picture to use with the list item.
SelImage Optional. An index or key into an ImageList control that identifies the picture to use with the list item when it is selected.
Indentation Optional. The level of indentation that will be applied to the item. The amount of space applied to each level of indentation is determined by the Indentation property.
ComboItem A reference to the new ComboItem object returned as a result of the successful completion of the function.

Remarks

If no arguments are passed to the Add method, the new object is created as the last object in the collection. No default values are specified, and Indentation is set to 0.

The Add method returns a reference to the newly created ComboItem object. You can use this to assign the new ComboItem to an object variable and then access or change any of its properties.