Your answer is what I expected. It's a little bit funny to create an object
for every inspector by the way. Another idea was to create a common
commandbar for all inspectors (temporary=false), but how remove the
commandbar when the user uninstalls the addin? The inspectors commandbar may
be not availble at this time. Next idea, set a handler to one of the open
inspectors close-events (withevents inspectorhandler as outlook.inspector,
when the inspectors.newinspector fires, set inspectorhandler = inspector).
When this inspector closes, check if other inspectors are open. If yes,
remapp the handler to an other inspector (find one through the inspectors
collection), else delete the commandbar and set the inspectorhandler =
nothing. So far, so good: It works fine (I thought). But when I close an
inspector and set the handler to an stickynote-inspector, the close-event
of the sticky-inspector doesn't fire if I close it. Instead, when I then
close Outlook, it says it could not save the changes in the sticky-note
(which seems to be already closed). After that, when I close the
error-message, the event fires (before Outlook goes). I don't tried to
access a commandbar from within the sticky-note-inspector (because that
could not work), really.
Good idea so far, but ...
Any experience like that ???
"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> schrieb im Newsbeitrag
news:%(E-Mail Removed)...
> Use an Inspector wrapper similar to the Explorer wrapper used in
> ItemsCB, create the toolbar in your code and handle the button press
> in the Inspector wrapper. You'd declare a WithEvents button in each
> Inspector class object in the wrapper collection.
>
> Each button should have its own unique Tag or otherwise each button
> that is created will fire when one of the buttons is pressed.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Lead Author, Professional Outlook 2000 Programming, Wrox Press
> Lead Author, Beginning VB 6 Application Development, Wrox Press
> Attachment Options
> http://www.slovaktech.com/attachmentoptions.htm
> Extended Reminders
> http://www.slovaktech.com/extendedreminders.htm
>
>
> "Hans-Joerg Propach" <(E-Mail Removed)> wrote in message
> news:#(E-Mail Removed)...
> > I develope an Outlook Com-Addin that needs a Commandbar with some
> > CommandbarButtons in mail- and contact-inspectors.
> > I use the NewInspectorEvent, check the type of the item and add the
> > commandbar and commandbarbuttons with temporary=true, so they are
> visible
> > only in this inspector.
> > Because of "temporary=true" i have to check every new inspector if
> the
> > commandbar already exists (normaly not) and add the bar and the
> buttons.
> > My problem: I have a global Object Commandbarbutton declared
> "withevents",
> > and everytime i get a newinspectorevent, iset it to the new created
> > commandbarbutton so i can get the users mouseclick. But when the
> user opens
> > several inspector windows, how can i be sure that the different
> > commandbarbuttons (remember, i create them often because of
> temporary=true)
> > fire the event ? Is every commandbarbutton with the same tag the
> same
> > commandbarbutton ???
> > On my dev-System everything works fine, but i can't believe it will
> work in
> > a user enviroment (user opens mail, opens word, opens another mail
> etc., and
> > then every of my for every inspector created commandbarbuttons fires
> the
> > event ???).
> >
> > Thank for any idea,
> >
> > Hans-Jörg "Keke" Propach, GIID
> >
> >
>
>