Adding Inspector Toolbars when Previous or Next are pressed

  • Thread starter Thread starter Sanjay Singh
  • Start date Start date
S

Sanjay Singh

I have created an addin using wrapper classes etc and it all works great
except ...

I add toolbar buttons to the Standard toolbar on a NewInpsector event. Each
button is given a unique tag to prevent the "multiple button click problem"
if more than one inspector is opened.

It all works as expected. My problem however is that if the user uses the
Previous and Next buttons,inan open Inspector to move between e-mails, then
extra buttons get added to the toolbar because a NewInspector event is fired
each time.

What can I do to make sure that I only add a new button when a real new
inspector is created?

Thanks in advance
Sanjay
 
Next and Previous will also be a problem if you are planning on supporting
Outlook 2000, where you don't get a NewInspector event when those buttons
are clicked. Always check for the existence of a toolbar or buttons you are
creating before you create them. If they exist already you can either hook
to them or more commonly you delete them and then create them again.

You can also hook the Close and Open events of whatever item type you are
handling in the Inspector wrapper class and see if the item is different
than the previous item to see if you need to re-hook it for Outlook 2000
applications where you won't get NewInspector.
 
Back
Top