How do you add command bars to the email reader window in Outlook?

C

Chris Newby

I've been working with creating an Add-In for Outlook using C# and have had
little trouble in adding command bars to the main Outlook application
window. But what I actually want is to add my command bar to the window
opened when you open an email. I'd also like to add the same options to the
email message context menu. Thoughts?

TIA//
 
T

Thaddaeus Parker

What you want to do is get the inspector for the mailitem and then add the
commandbar to that inspector. Your best bet is to wrap the Outlook MailItem
and when the explorer fires the inspectors_NewInspector event. You
instantiate the wrapped mail item with the inspector.CurrentItem as a
parameter. During the ctor call you grab the MailItem's commandbars and
either cycle through each commandbar to find the right commandbar or go
ahead and add your own. Make sure that you create your commandbar so that
it temporary. otherwise you will end up with a lot of fired events.

One good example is on http://www.outlookcode.com/codedetail.aspx?id=797 by
Helmut Obertanner.

I think that should get pushed in the right direction...

Thaddaeus.
 
C

Chris Newby

Thaddaeus, awesome! ... that was very helpful and worked great.

Thank you very much//
 

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