Ribbon Buttom Name Property

Mar 12, 2014 at 6:31 PM
I am trying to write one click event for multiple ribbon buttons. In the click event, I am trying to determine which button was clicked. I found some code that I was hoping would work:
   Dim btn As Button = DirectCast(sender, Button)
   Select Case btn.Name
        Case "rbOpen"

        Case "rbNew"

    End Select
So, I changed the Button to RibbonButton:
   Dim btn As RibbonButton = DirectCast(sender, RibbonButton)
   Select Case btn.Name
        Case "rbOpen"

        Case "rbNew"

    End Select
However, I am getting the following error:
    'Name' is not a member of 'System.Windows.Forms.RibbonButton'.
Is there a way to determine which ribbon button was click?

I know that I can use the text property. However, that may cause other issues for buttons that I do not want the text to show.

Thanks
Developer
Mar 12, 2014 at 6:56 PM
When did you last update the sources of the Ribbon (not release)?
I added the Name property to RibbonItems in February:
https://officeribbon.codeplex.com/SourceControl/changeset/25886
Marked as answer by toAtWork on 3/13/2014 at 12:22 AM
Mar 12, 2014 at 7:03 PM
I downloaded the source in Janauary from the home page. I did not know about the updates. I guess I have some changes to make.

Thanks
Mar 13, 2014 at 1:12 AM
I made the updates and the Name property is working great.

Thnaks