The item element is used to create static items that must be used within a gallery, comboBox, or dropDown.
Graphical View of item Attributes
The following figure shows all the visible graphical attributes you can set on the item control.
This is specified using the following XML:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"
onLoad="IRibbonUI_onLoad">
<!--true: show only your tab in Excel-->
<ribbon startFromScratch="true">
<tabs>
<tab id="customTab"
label="Custom Tab">
<group id="customGroup"
label="Custom Group">
<dropDown id="ddSelectColor"
label="Select Color">
<item id="ItemColor_0"
label="White"
imageMso="AppointmentColor0"
screentip="White"
supertip="This is White!"/>
<item id="ItemColor_1"
label="Red"
imageMso="AppointmentColor1"
screentip="Red"
supertip="This is Red!"/>
<item id="ItemColor_2"
label="Blue"
imageMso="AppointmentColor2"
screentip="Blue"
supertip="This is Blue!"/>
</dropDown>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Parent Elements
Children Elements
The item element does not support child objects of any kind, so it cannot have any embedded controls.
Required Attributes
The item element has only one attribute, the id
. Unlike other elements, there is no idMso
or idQ
attribute available for the item control.
ATTRIBUTE | WHEN TO USE |
---|---|
id | Create your own item |
Optional Attributes and Callbacks
STATIC ATTRIBUTE | DYNAMIC ATTRIBUTE | ALLOWED VALUES | DEFAULT VALUE | VBA CALLBACK SIGNATURE FOR DYNAMIC ATTRIBUTE |
---|---|---|---|---|
image | (none) | 1 to 1024 characters | (none) | (none) |
imageMso | (none) | 1 to 1024 characters | (none) | (none) |
label | (none) | 1 to 1024 characters | (none) | (none) |
screentip | (none) | 1 to 1024 characters | (none) | (none) |
supertip | (none) | 1 to 1024 characters | (none) | (none) |
Using Built-in item Controls
Excel doesn't have a built-in item element.
Creating Custom item Controls
Please read the section: Graphical View of item Attributes