Adding CommandBarPopup into the a specific Inspctor

M

Michael Reukauff

Hi

I want to add a CommandBarPopup with some ComandBarButtons to the Inspectors
Menu. But this menu should only appear when the inspector is showing an
e-mail. I am using VS2005 and the VSTO 2005. Right now I create the
CommandBarPopup in the newInspector_Event. But this event is fired only
once, or am I missing something.

What I need is an event which is fired when the Inspector opens up a new
window to show an e-mail, contact etc.

So, how I can I show the menu only when the inspector is showing an e-mail?

Thanks
Michael
 
K

Ken Slovak - [MVP - Outlook]

Use NewInspector. Inspector.CurrentItem.Class = olMail would do the trick.
Test for that before you do anything else to see if you want to handle that
Inspector.
 
J

Jim

Hi Michael how are you add the newInspector event?
Sometimes if you add an event and the object you are adding it to goes
out of scope you will lose the event.
So one thing you could do is declare Outlook.Inspectors _inspectors as
global scope and add the event this way.
Hope this helps.
 
J

Jim

Hi Michael how are you add the newInspector event?
Sometimes if you add an event and the object you are adding it to goes
out of scope you will lose the event.
So one thing you could do is declare Outlook.Inspectors _inspectors as
global scope and add the event this way.
Hope this helps.
 
M

Michael Reukauff

Hi Ken

Thanks for your fast answer.

Where should I check this? In the NewInspector Event? I did this and it
doen't work at all. The NewInspector event is only fired once on my system
(Outlook 2003).

What I need is an event like Inspector_Activate, but this doesn't exists.

When I read at first an e-mail, the CommandBarPopup is in every menu. If
read at first a contact, then the menu is missing, but when I open up an
e-mail, the menu appears again in every inspector.

Thanks
Michael
 
M

Michael Reukauff

Hi Jim

Thanks, that's it. I didn't remember this fact, but I know about this.

Thanks again
Michael
 
K

Ken Slovak - [MVP - Outlook]

Ummm. NewInspector fires every time a new Inspector is added to the
Inspectors collection. There certainly is an Inspector.Activate event but
before you could handle that you'd need to handle NewInspector to get a
handle to the new Inspector.

Use the Object Browser to see what properties, methods and events are
available to you for any object or collection.

If NewInspector doesn't fire for every new added Inspector then you are
doing something drastically wrong.
 
M

Michael Reukauff

Hi Ken

Yes, it was my mistake. See my other posting to Jim.

Thanks for your help.
Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top