I'm trying to get the name
of a clicked button on the "Developer" Tab on the ribbon to use as a string in a macro in Outlook version 2212 with M365.

Sub ButtonNameDisplay()
Dim ButtonText As String
ButtonText = ActiveSheet.Shapes(Application.Caller).Name
MsgBox (ButtonText)
End Sub
However, ActiveSheet is only for Excel. And I couldn't get the CommandBarButton.Caption property to work either
ButtonText = Application.ActiveInspector.CommandBarButton.Caption
What can one set the ButtonText
string value to so the message box displays the button name [TestButtonName
] when clicked?