property Item.ID as Long
Retrieves or sets a value that specifies the item's identifier.

TypeDescription
Long A Long expression that defines the item's identifier. This property can be specified at adding time, by using the ID parameter of the Add method.
Use the ID property to associate an unique identifier to each item. You can use the Item property of the Ribbon component to get the Item object based on its identifier. Use the Debug property to display the identifiers for all visible items, for debugging purposes. The First number in the [] parenthesis indicates the item's ID property. Use the Caption property to specify the item's caption. Use the UserData property to associate any extra data to your items.

How can I specify/assign the item's identifier?

VBA (MS Access, Excell...)

With Ribbon1
	.Debug = True
	With .Items
		.Add "ID 1",0,1000
		.Add("ID 2").ID = 1001
		.Add("").ToString = "ID 3[id=1002]"
	End With
	.Refresh 
End With

VB6

With Ribbon1
	.Debug = True
	With .Items
		.Add "ID 1",0,1000
		.Add("ID 2").ID = 1001
		.Add("").ToString = "ID 3[id=1002]"
	End With
	.Refresh 
End With

VB.NET

With Exribbon1
	.Debug = True
	With .Items
		.Add("ID 1",0,1000)
		.Add("ID 2").ID = 1001
		.Add("").ToString = "ID 3[id=1002]"
	End With
	.Refresh()
End With

VB.NET for /COM

With AxRibbon1
	.Debug = True
	With .Items
		.Add("ID 1",0,1000)
		.Add("ID 2").ID = 1001
		.Add("").ToString = "ID 3[id=1002]"
	End With
	.Refresh()
End With

C++

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXRIBBONLib' for the library: 'ExRibbon 1.0 Control Library'

	#import <ExRibbon.dll>
	using namespace EXRIBBONLib;
*/
EXRIBBONLib::IRibbonPtr spRibbon1 = GetDlgItem(IDC_RIBBON1)->GetControlUnknown();
spRibbon1->PutDebug(VARIANT_TRUE);
EXRIBBONLib::IItemsPtr var_Items = spRibbon1->GetItems();
	var_Items->Add(L"ID 1",long(0),long(1000));
	var_Items->Add(L"ID 2",vtMissing,vtMissing)->PutID(1001);
	var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"ID 3[id=1002]");
spRibbon1->Refresh();

C++ Builder

Ribbon1->Debug = true;
Exribbonlib_tlb::IItemsPtr var_Items = Ribbon1->Items;
	var_Items->Add(L"ID 1",TVariant(0),TVariant(1000));
	var_Items->Add(L"ID 2",TNoParam(),TNoParam())->ID = 1001;
	var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"ID 3[id=1002]";
Ribbon1->Refresh();

C#

exribbon1.Debug = true;
exontrol.EXRIBBONLib.Items var_Items = exribbon1.Items;
	var_Items.Add("ID 1",0,1000);
	var_Items.Add("ID 2",null,null).ID = 1001;
	var_Items.Add("",null,null).ToString = "ID 3[id=1002]";
exribbon1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="Ribbon1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
	Ribbon1.Debug = true;
	var var_Items = Ribbon1.Items;
		var_Items.Add("ID 1",0,1000);
		var_Items.Add("ID 2",null,null).ID = 1001;
		var_Items.Add("",null,null).ToString = "ID 3[id=1002]";
	Ribbon1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="Ribbon1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
	With Ribbon1
		.Debug = True
		With .Items
			.Add "ID 1",0,1000
			.Add("ID 2").ID = 1001
			.Add("").ToString = "ID 3[id=1002]"
		End With
		.Refresh 
	End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axRibbon1.Debug = true;
EXRIBBONLib.Items var_Items = axRibbon1.Items;
	var_Items.Add("ID 1",0,1000);
	var_Items.Add("ID 2",null,null).ID = 1001;
	var_Items.Add("",null,null).ToString = "ID 3[id=1002]";
axRibbon1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
	COM com_Item,com_Items;
	anytype var_Item,var_Items;
	;

	super();

	exribbon1.Debug(true);
	var_Items = exribbon1.Items(); com_Items = var_Items;
		com_Items.Add("ID 1",COMVariant::createFromInt(0),COMVariant::createFromInt(1000));
		var_Item = COM::createFromObject(com_Items.Add("ID 2")); com_Item = var_Item;
		com_Item.ID(1001);
		var_Item = COM::createFromObject(com_Items.Add("")); com_Item = var_Item;
		com_Item.ToString("ID 3[id=1002]");
	exribbon1.Refresh();
}

Delphi 8 (.NET only)

with AxRibbon1 do
begin
	Debug := True;
	with Items do
	begin
		Add('ID 1',TObject(0),TObject(1000));
		Add('ID 2',Nil,Nil).ID := 1001;
		Add('',Nil,Nil).ToString := 'ID 3[id=1002]';
	end;
	Refresh();
end

Delphi (standard)

with Ribbon1 do
begin
	Debug := True;
	with Items do
	begin
		Add('ID 1',OleVariant(0),OleVariant(1000));
		Add('ID 2',Null,Null).ID := 1001;
		Add('',Null,Null).ToString := 'ID 3[id=1002]';
	end;
	Refresh();
end

VFP

with thisform.Ribbon1
	.Debug = .T.
	with .Items
		.Add("ID 1",0,1000)
		.Add("ID 2").ID = 1001
		.Add("").ToString = "ID 3[id=1002]"
	endwith
	.Refresh
endwith

dBASE Plus

local oRibbon,var_Item,var_Item1,var_Items

oRibbon = form.Activex1.nativeObject
oRibbon.Debug = true
var_Items = oRibbon.Items
	var_Items.Add("ID 1",0,1000)
	// var_Items.Add("ID 2").ID = 1001
	var_Item = var_Items.Add("ID 2")
	with (oRibbon)
		TemplateDef = [Dim var_Item]
		TemplateDef = var_Item
		Template = [var_Item.ID = 1001]
	endwith
	// var_Items.Add("").ToString = "ID 3[id=1002]"
	var_Item1 = var_Items.Add("")
	with (oRibbon)
		TemplateDef = [Dim var_Item1]
		TemplateDef = var_Item1
		Template = [var_Item1.ToString = "ID 3[id=1002]"]
	endwith
oRibbon.Refresh()

XBasic (Alpha Five)

Dim oRibbon as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oRibbon = topparent:CONTROL_ACTIVEX1.activex
oRibbon.Debug = .t.
var_Items = oRibbon.Items
	var_Items.Add("ID 1",0,1000)
	' var_Items.Add("ID 2").ID = 1001
	var_Item = var_Items.Add("ID 2")
	oRibbon.TemplateDef = "Dim var_Item"
	oRibbon.TemplateDef = var_Item
	oRibbon.Template = "var_Item.ID = 1001"

	' var_Items.Add("").ToString = "ID 3[id=1002]"
	var_Item1 = var_Items.Add("")
	oRibbon.TemplateDef = "Dim var_Item1"
	oRibbon.TemplateDef = var_Item1
	oRibbon.Template = "var_Item1.ToString = \"ID 3[id=1002]\""

oRibbon.Refresh()

Visual Objects

local var_Items as IItems

oDCOCX_Exontrol1:Debug := true
var_Items := oDCOCX_Exontrol1:Items
	var_Items:Add("ID 1",0,1000)
	var_Items:Add("ID 2",nil,nil):ID := 1001
	var_Items:Add("",nil,nil):ToString := "ID 3[id=1002]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oRibbon,var_Items

oRibbon = ole_1.Object
oRibbon.Debug = true
var_Items = oRibbon.Items
	var_Items.Add("ID 1",0,1000)
	var_Items.Add("ID 2").ID = 1001
	var_Items.Add("").ToString = "ID 3[id=1002]"
oRibbon.Refresh()

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Set ComDebug to True
	Variant voItems
	Get ComItems to voItems
	Handle hoItems
	Get Create (RefClass(cComItems)) to hoItems
	Set pvComObject of hoItems to voItems
		Get ComAdd of hoItems "ID 1" 0 1000 to Nothing
		Variant voItem
		Get ComAdd of hoItems "ID 2" Nothing Nothing to voItem
		Handle hoItem
		Get Create (RefClass(cComItem)) to hoItem
		Set pvComObject of hoItem to voItem
			Set ComID of hoItem to 1001
		Send Destroy to hoItem
		Variant voItem1
		Get ComAdd of hoItems "" Nothing Nothing to voItem1
		Handle hoItem1
		Get Create (RefClass(cComItem)) to hoItem1
		Set pvComObject of hoItem1 to voItem1
			Set ComToString of hoItem1 to "ID 3[id=1002]"
		Send Destroy to hoItem1
	Send Destroy to hoItems
	Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oItems
	LOCAL oRibbon

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oRibbon := XbpActiveXControl():new( oForm:drawingArea )
	oRibbon:CLSID  := "Exontrol.Ribbon.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
	oRibbon:create(,, {10,60},{610,370} )

		oRibbon:Debug := .T.
		oItems := oRibbon:Items()
			oItems:Add("ID 1",0,1000)
			oItems:Add("ID 2"):ID := 1001
			oItems:Add(""):ToString := "ID 3[id=1002]"
		oRibbon:Refresh()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN