Adding toolbar button to email inspector window in Outlook

  • Thread starter Thread starter Sue
  • Start date Start date
S

Sue

Hi

I am adding a toolbarbutton to run code in my addin to
Outlook each time an inspector is created to look at a
message.

The goal is to be able to run code in my add-in while a
email is open.

I use

Dim WithEvents mcbMenuCommandBar As Office.CommandBarButton

The problem is that when I open a second email window, the
first windows button no longer runs the code.

Please let me know a better way of doing this so the
button works in all email windows
 
You need to use an Inspector wrapper with the button created in the class
module used to wrap Inspectors. Each button must have a unique Tag property
or else all buttons would fire on the Click event. Google for Inspector
wrapper, there have been a number of them presented in these groups.

Also, download and study the ItemsCB VB6 COM addin sample, which has an
Explorer wrapper that can be used as a model for an Inspector wrapper and
shows the best practices and common workarounds for bugs used for Outlook
COM addins. ItemsCB can be downloaded from the Resources page at
www.microeye.com
 
Back
Top