Office context menu add-in for Excel, Outlook, Word, PowerPoint
The blog is about an add-in (with the source code) that adds a button to all context menus of Excel, Outlook, PowerPoint, Project, Publisher, Visio and Word in Office 2010-2013 (see updates below). The button shows the name of the context menu. Clicking the button puts the following values to the Clipboard: 1) context menu name, 2) context object type name.
A while back Microsoft published an add-in that added a button to all context menus in main applications of Office 2010. The add-in was highly useful for an Office add-in developer. You could easily find what exactly Ribbon context menu Office 2010 showed in this or that context. That add-in is now unavailable for download. The add-in below could replace that add-in.
The add-in adds a Ribbon button to all context menus in Excel, Outlook, PowerPoint, Project, Publisher, Visio and Word from Office 2010-2013. The button caption is set to the name of the context menu showing the button. Clicking the button puts the following info to the Clipboard: 1) context menu name, 2) context object type name. A couple of examples:
Context menu name = "ContextMenuGroupHeader" Context object type name="Selection"
Context menu name = "ContextMenuThumbnail" Context object type name="DocumentWindow"
By default the add-in installs to {user profile}\AppData\Local\Add-in Express\Office Context Menu Add-in. The source code project is located in the Source Code subfolder. The project was written in C# using Add-in Express 7.7 in Visual Studio 2010.
Enjoy!
Update. 15-Jun-2016. The project is rebuilt using Add-in Express 8.2. Now it supports Office 2016. Also, I fixed a problem preventing showing the custom button in the Word menus shown in Outlook inspector windows. HTH
Update. 23-Mar-2018. Supported is OneNote 2010-2016. Good!
Update. 13-Dec-2018. Since the Application.Version property of Office 2019 applications returns “16.XXXX”, Office 2019 is supported. In case you see any issue try this: install the add-in, grab the source code, uninstall the add-in and rebuild the source code with the Add-in Express version you are using.
19 Comments
I would like implement outlook 2010 Add-In that will help to call to a outlook contact by my local application.
Scenario:
Need a “call to dial” application that help to call a number of outlook contact.
When click on outlook contact, then Add-In must be get called & divert that call to my local application.
e.g. MS Lync Add-In works with Outlook contacts to call a selected contact’s number.
I have seen many video & studied many tutorial and but didnt get info that how to implement desired scenario.
I used below approaches
With Add-In Express: 1. MS Visual Studio 2013-> Visual C#-> Office-> Office Add-In.
With VSTO: 2. MS Visual Studio 2013-> Other Project Type-> Extensibility->ADX Add->In
Thanks
You can add a custom button to the context menu and also to the ribbon so that the user clicks the button to send required data to your application. If you have problems with doing this, contact us using the contact form at https://www.add-in-express.com/support/askus.php.
Hi,
I installed this add-in on my system. But when i open word/excel from windows after, i could not see the button you mentioned in the context menus. Does it only work while debugging/developer mode?
Am i missing something?
Hello Babu,
This is a usual add-in which should work right after installing it. Check the list of add-ins to make sure the add-in is loaded. If it isn’t, reinstall the add-in, start Excel (or Word, or PP, …) and check adxloader.log in Documents\Add-in Express. If the last record related to this add-in doesn’t read “The instance of the managed add-in class has been created successfully”, please send me the log file using the contact form at https://www.add-in-express.com/support/askus.php.
Hi Andrei,
I desperately want to remove the clutter from my right-click context menu in Outlook 2016. I installed your context menu add-in and now have the information:
Context menu name = “ContextMenuMailItem”
Context object type name=”Selection”
I’ve scoured the registry for “ContextMenuMailItem”, installed visual editor, etc. but cannot sort how to find this and remove the extraneous items.
Thanks,
Tom
Hello Tom,
Clutter? Is this a control(s) left from some add-in? If so, will it disappear if you turn off all COM add-ins? If you talk about built-in Outlook controls, you can’t remove a built-in control from the Outlook UI. If the above doesn’t help, please contact me using the contact form at https://www.add-in-express.com/support/askus.php.
Hi Andrei,
No, I’m sorry. I don’t mean the Clutter folder. I mean remove all the unwanted items listed in the right click menu. I really only need 2 or 3 like “Move” and “Junk”. Instead I have 18 listed.
Thank you,
Tom
Tom,
No problem. I didn’t mean the Clutter folder either ))
If you talk about the controls which Outlook 2016 shows when you right-click a mailitem(s), you can remove only some of them. To do this, turn off the COM add-ins creating and adding custom controls to that context menu. All remaining controls are built in Outlook and you cannot hide them. Some (or all) of the controls on that context menu may be disabled; they’ll be grayed out but still, they will stay on the context menu. Doing this requires that you create a COM add-in disabling the Ribbon commands associated with these controls.
Thank you Andrei for your help!
Tom
The Office Context Menu Add-in installer stops with a message that it can’t find the msi file, even though its right there and in fact is what I double-clicked to start the installation. Is there a version of this tool that works (Win 8.1, Office 2016 via 365)?
Alternatively, is there a list anywhere of the Excel context menus?
Hello Jon,
I have just installed the add-in via MSI and then via setup.exe, it works for me. Could you please try to install via setup.exe?
>> Alternatively, is there a list anywhere of the Excel context menus?
The IDs of the built-in Ribbon controls can be found on the Microsoft web site:
Office 2007
Office 2010
Office 2013
Thank you so much Andrei, for sharing this add-in and the source code!
This is exactly what I’ve been looking for since for ever.
Welcome!
I just loaded this tool and restarted Outlook to activate it. It works great! But even better, it’s doing exactly what I have been trying to figure out. When I right click on a hyperlink in an email in the Preview window, I see your program listed in the context menu itself. How do you do that? I’m trying to add my own macro to that list and have been unable to find any examples on how to do that. I’m running Outlook 365.
Thanks!
Hello Craig,
The source code is in C:\Users\{user profile}\AppData\Local\Add-in Express\Office Context Menu Add-in\Source Code\. As to customizing context menus, find more details at https://msdn.microsoft.com/en-us/library/office/ee691832(v=office.14).aspx.
Thanks, Andre! I saw that code. Is there a way to do this in VBA as opposed to C? I’ve read the Microsoft page you reference but it appears to show how to do that with a standalone addin file. Outlook seems to operate differently where the addin is integrated. I can run the Custom UI, but unlike Excel where I know what .xlam to read in, I have no idea what file I would apply the Custom UI to. Any hints are more than welcome!
Hello Craig,
Ah, unlike Excel or Word, Outlook doesn’t have documents. This means you can’t use Custom UI Editor and this means you can’t use VBA to add custom items to an Outlook 2013+ context menu.
Thanks, Andrei! I’ve given up on the context menu idea and have instead written a couple of macros that read the current pane (probably works better than the context menu appraoch anyway). Now that I have the macros completed, do you have any suggestions for how to put them on the Menu ribbon? I have added them using the QAT, but that’s not my preferred method. Also, can you suggest any links to research how I can package my macros so I can send them to another user for a simple automatic installation/activation? Thanks!
Hello Craig,
No, I don’t know about deploying Outlook VBA macros; never did this. Must be very cumbersome, I suppose.