S
saavdi
Hi,
I am developing an application level COM addin for Office.
the addin has lots of buttons, and several of them appear twice in the
toolset, (once on the toolbar, once on menubar).
I have created separate class modules for each button.
The problem is that when I have multiple instances of the same button on
the toolset, clicking any one of them fires the event twice. How can I
prevent this??
here is the my code which does the linking..
Set Mycommandbars =
App.CommandBars.FindControls(Office.msoControlButton, , "MyTAG")
If Not Mycommandbars Is Nothing Then
For Each Mycommandbar In Mycommandbars
Set objItem = New clsMYClass
Set objItem.myButton = Mycommandbar
Call addToArray(objMenuItem) 'used to store the items in an
array
Next
End If
I thought of creating different tags, but does not help, as the users
would often customize(duplicate/move) the tools.
Any help appreciated!
I am developing an application level COM addin for Office.
the addin has lots of buttons, and several of them appear twice in the
toolset, (once on the toolbar, once on menubar).
I have created separate class modules for each button.
The problem is that when I have multiple instances of the same button on
the toolset, clicking any one of them fires the event twice. How can I
prevent this??
here is the my code which does the linking..
Set Mycommandbars =
App.CommandBars.FindControls(Office.msoControlButton, , "MyTAG")
If Not Mycommandbars Is Nothing Then
For Each Mycommandbar In Mycommandbars
Set objItem = New clsMYClass
Set objItem.myButton = Mycommandbar
Call addToArray(objMenuItem) 'used to store the items in an
array
Next
End If
I thought of creating different tags, but does not help, as the users
would often customize(duplicate/move) the tools.
Any help appreciated!