get item label in a ribbon dropdown click event

Answered get item label in a ribbon dropdown click event

  • Tuesday, April 03, 2012 4:51 AM
     
     

    Can I get the label of the item that was clicked in the dropdown click event? The dropdown control, itemId and itemIndex are provided but I cannot see how to get the itemlabel.

    thanks,

    John


    John C Svercek


    • Edited by JCSvercek Tuesday, April 03, 2012 5:36 PM
    •  

All Replies

  • Tuesday, April 03, 2012 1:49 PM
     
     

    by formula index


    Oskar Shon, Office System MVP

    Press if Helpful; Answer when a problem solved

  • Tuesday, April 03, 2012 5:44 PM
     
     

    I apologies, it was late and my request was quite vague. To clarify

    I have an addin for Outlook that creates a dropdown control on the Mail Explorer Ribbon. I implemented code in the click event of the dropdown. This gives me the dropdown control, the Item ID and the Item Index of the clicked item. How do I get the item label?

    Thanks,


    John C Svercek

  • Wednesday, April 04, 2012 7:07 AM
     
     Answered Has Code

    Sry. my mistake, I do not read well that you was talking about ribbon.

    I use that construction - maybe similar?

    Dim Menu_Temporary As String If GetSetting(APPNAME, "Settings", "Menu_Temporary", True) = True Then Menu_Temporary = "True" Else Menu_Temporary = "False" If Val(Application.Version) >= 14 Then Set objCommandBar = Application.ActiveExplorer.CommandBars("Standard") Dim cont& For cont = 1 To objCommandBar.Controls.Count If InStr(1, objCommandBar.Controls(cont).Caption, _ "Synchronizacja danych") > 0 Then Exit Sub Next Else Set objCommandBar = Application.ActiveExplorer.CommandBars.Add(Name:=NazwaPaska, Position:=msoBarTop, Temporary:=Menu_Temporary) End If objCommandBar.Visible = True '.....

    If GetSetting(APPNAME, "Settings", "Firma", "") = "Veracomp" Then
        Set MenuItem = objCommandBar.Controls.Add(Type:=msoControlPopup)
            With MenuItem
                .Caption = "Na skrót&y"
                    If GetSetting(APPNAME, "Settings", "Menu_grupy", 0) = 0 Then
                        .BeginGroup = Menu_Grupa
                    Else
                        .BeginGroup = False
                    End If
                .TooltipText = "Tworzenie list aktyności, zbieranie informacji o kontaktach, etc..."
            End With

    '...... Set objCommandBarButton = MenuItem.Controls.Add(Type:=msoControlButton) With objCommandBarButton .Caption = "CRM - Szukaj klienta po nazwie" .Style = msoButtonIconAndCaption .FaceId = 1980 .OnAction = "Znajdz_Klienta_w_CRM" End With '.... Set objCommandBarButton = Nothing Set MenuItem = Nothing End If



    Oskar Shon, Office System MVP

    Press if Helpful; Answer when a problem solved

  • Saturday, April 21, 2012 5:07 AM
     
     

    I do not see a solution here. Where is the click event?

    What I want to do is get the label associated with the button that was clicked, the only properties I know in the click event are listed above. How do I reference the label knowing these properties?