Need to isolate Winword menu and outlook new mail inspector menu

R

ramz_g

Hi,

I have developed an add-in(shared add-in) for ms-word using C#, VS2005. This
add-in adds a menu to the standard menu bar of ms-word and it works fine. But
my problem is that this add-in appears in ms-outlook's compose mail
inspector, which I dont want. I tried to remove the menu from outlook, but
when I did it, the menu in ms-word also got deleted. I understand that
outlook 2003 uses ms-word as the default word editor and that's why the menus
are also common. But I really don't want the menu to appear in outlook's new
inspector. How do I go about it? Please suggest...
 
K

Ken Slovak - [MVP - Outlook]

Handle the WindowActivate() event and in that event check that
wn.Envelope.Visible == false. That's a Word Document object. If
wn.Envelope.Visible == true it's an Outlook Inspector with a MailItem using
WordMail. In that case set your UI to not visible or enabled.
 
K

Ken Slovak - [MVP - Outlook]

I'm not sure what you mean. You hook that event in your Word addin code,
usually in the startup code.

Where are you trying to hook that event and how?
 
R

ramz_g

Hi Ken,
I hooked up that event in my word add-in code only... But when I tried to
debug the event (without adding any code to the event) while using outlook,
the breakpoint was never hit when I opened the new inspector window... Then I
included the code to either show or hide my menu and it worked fine... Thanks
a lot for your reply... It works!!!

But I just got another, rather basic question... Why arent the breakpoints
being hit when I try to debug the event while I'm using the outlook inspector
window, which is indeed a wordmail...

Thanks a ton...
ramz_g
 
K

Ken Slovak - [MVP - Outlook]

I don't know why you're not getting that event in debug mode, since it's
obviously firing at runtime.
 

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