control array for addins
Visual Basic
1
Posts
1
Posters
0
Views
1
Watching
-
I am trying to add dynamic drop down menu in my office com addin toolbar. I use control array for drop down menu, but I can only get the event for the first one instead of each menu item how can I fix this so that events can be generated in each menu item Dim WithEvents cbeButton As Office.CommandBarButton Dim cbcButton() As Office.CommandBarButton private sub CreateMenu() for i = 0 to 3 ReDim Preserve cbcCatalogButton(i) cbcButton(i).caption = i set cbeButton = cbcButton(0) next i end Sub Private Sub cbeCatalogButton_Click(ByVal Ctrl As Office.CommandBarButton, _ CancelDefault As Boolean) msgbox "hello" end Sub