Set the CommandBarButton.Tag property to a unique string for each *instance*
of the button.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Markus Kraemer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have an outlook addin setting up a new commandbar each time a new
> inspector is created (outlook 2000).
> The CommandBarButtons are hold in static variables within
> connect-class.
> If the CommandBarButtons still exists, the found Buttons are set to
> the static
> variables again. Each time the inspector is launched the Click-events
> are bound
> to the same OnClickMethod.
>
> My problem:
> If I launch three inspectors (no matter if they are closed or not)
> clicking on
> a CommandBarButton will cause the OnClickMethod to be executed three
> times.
>
> I thing I've done ervery thing as descriped in microsoft sample
> "Developing .NET Smart Clients for Microsoft Office XP".
>
> What's wrong. Is it necessary to unregister the click-events each time
> an
> inspector is closed? I do this ony when outlook is terminated.
>
> thanks in advance
> Markus Kraemer