Need to add button to menu in email window

L

lanem

I have an addin that creates a button in the Actions menu in the main window
of Outlook. I need to add this same button to the window when I open an
email. So, if I open an email and go to the Actions menu, the button would
be there. So far, it's just in the main outlook window's action menu.
Thanks.
 
K

Ken Slovak - [MVP - Outlook]

Add your button the Inspector in the NewInspector event handler. If more
than one item is opened you will need an Inspector wrapper and to use a
unique Tag property for the button to ensure that the Click event will fire
correctly for that and only that Inspector.

See http://www.slovaktech.com/code_samples.htm#InspectorWrapper for an
example Inspector wrapper in VB 6.
 
K

Ken Slovak - [MVP - Outlook]

When the NewInspector event handler fires you instantiate a new instance of
the clsInspWrap class module. That gets added to your global g_colInspWrap
collection. Since each class module is instantiated with a different
Inspector object and has declarations for a button in it the button's Click
event handler will fire when the button in that Inspector is clicked. If a
unique Tag property is assigned to each button in each Inspector the Click
handler will fire for that button and only that button.

Download and study the example, it shows how to do all this.
 

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