Office add-ins and popup menus

  • Thread starter Thread starter Vasily Pavlik
  • Start date Start date
V

Vasily Pavlik

Hi all.

I'm writing an add-in for Word and Outlook.
It creates own toolbar and some menu items just like described in MSDN
example.
Everything works fine. But I have a problem with popup menus (mouse right
click).

Example. If user clicks on e-mail body in HTML format then we can see "Open
in Word 10" as an item of this menu.
I think that Outlook doesn't display this item itself. Perhaps it uses
plug-in ?

I didn't find anything in CommandBars interface.

Thanks in advance.
 
Outlook does not expose the right-click context menu in its CommandBars collection. AFAIK, the only time you'll see a new right-click command is when the item is using a custom form with one or more custom actions.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
I've just found a solution.

Thanks to "Dmitry Streblechenko (MVP)" and his great utility Outlook Spy.
Outlook has an interface _Explorer, which has a list of CommandBars.
The last one is what I was looking for. It has name "Context Menu" and
contains menu items
for current document in preview pane or edit window.

With Word I need to make additional steps.
Word has many menus for different parts of document.
For instance:
Text
Cu&t
&Copy
&Paste
Delete Co&mment
&Font...
&Paragraph...
Bullets and &Numbering...
&Hyperlink...
&Who Is...
&Define
S&ynonyms
Tr&anslate

All that I need is to locate this CommandBar and insert my own item to it.

That's all.

Thanks to Dmitry Streblechenko again :)
 
Even though "Context Menu" may be in the CommandBars collection, you still
cannot modify it: Outlook will return an error if you try to do that.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Yes. You are probably right. I didn't try to modify this menu in Outlook
yet.
First of all I need to modify menus in Word. And this works fine.
Outlook is an optional requirement.

Anyway, thanks for Spy utilities :)
 
You're right. "Context Menu" CommandBar appears only when user clicks right
button.
It is situated at _Application.ActiveExplorer.CommandBars if user invoked
this menu at least once.

As Dmitry Streblechenko said, Outlook does not allow to modify "Context
Menu" (very interesting why ?)
During spying I see that this menu is modified depends on view where it is
displayed. Word adds its own item to this menu.
Is there any (un)legal mechanism to customize this menu ?

Thanks anyway for answer.

Outlook does not expose the right-click context menu in its CommandBars
collection. AFAIK, the only time you'll see a new right-click command is
when the item is using a custom form with one or more custom actions.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
Back
Top