inspector in outlook 2003 - C#

J

Jorgen D. Andersen

I am developing an Add-In for Outlook 2003 using C#.

I have created a new inspector for adding commandbuttons.
My inspector starts ok, and my buttons appear, but i only want them in the
reading pane, and mail composing pane. Not in contacts and tasks and so on.

In other words, how do I detect that I am in the mail composing "window"


And as a bonus question, how do I add a commandbutton the the "standard"
toolbar in outlook 2003

Best, Jorgen
 
K

Ken Slovak - [MVP - Outlook]

In NewInspector check for Inspector.CurrentItem.Class == olMail. Don't add
your UI there though, do that in the first Inspector.Activate event.

Outlook.CommandBar bar = _inspector.CommandBars["Standard"]

Add your button to that.
 
J

Jorgen D. Andersen

Thank you very much

if (Inspector.CurrentItem is Outlook.MailItem) MessageBox.Show("The current
Inspector is Outlook.MailItem");

did the trick - and the standard toolbar also

Best - Jorgen

Ken Slovak - said:
In NewInspector check for Inspector.CurrentItem.Class == olMail. Don't add
your UI there though, do that in the first Inspector.Activate event.

Outlook.CommandBar bar = _inspector.CommandBars["Standard"]

Add your button to that.




Jorgen D. Andersen said:
I am developing an Add-In for Outlook 2003 using C#.

I have created a new inspector for adding commandbuttons.
My inspector starts ok, and my buttons appear, but i only want them in the
reading pane, and mail composing pane. Not in contacts and tasks and so
on.

In other words, how do I detect that I am in the mail composing "window"


And as a bonus question, how do I add a commandbutton the the "standard"
toolbar in outlook 2003

Best, Jorgen
 

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