ContextMenu in MSProject

Add-in Express™ Support Service
That's what is more important than anything else

ContextMenu in MSProject
 
matej golob




Posts: 4
Joined: 2013-01-15
I'm developing addin for MSProject 2013. I would like to add custom context menu when I click with right mouse button on some task in project. Is this possible with add-in-express?
I have looked at ADXContextMenu, but I'm little "confused". Is this right "component" for this? Is it possible to "control" (add my own command) context menu anywhere in MSProject?

Any help appreciated.

Matej
Posted 07 Feb, 2013 02:18:32 Top
Andrei Smolin


Add-in Express team


Posts: 14690
Joined: 2006-05-11
Hello Matej,

Office 2010-2013 context menus are Ribbon based. That's whay you need to use the ADXRibbonContextMenu component for adding a custom item to a context menu in Project 2013.

To find context menu names, I suggest that you install this add-in:

http://archive.msdn.microsoft.com/contextmenusaddin/Release/ProjectReleases.aspx?ReleaseId=4891

If it is registered it adds an item to every context menu; the item caption is the name of the context menu. Really simple and useful.

To let your context menu item visible on some of the tasks, you need to handle the PropertyChanging event of the Ribbon item (typically ADXRibbonButton). In the event handler, you wait for e.PropertyType == ADXRibbonControlPropertyType.Visible, retrieve e.Context and set e.Value = {true/false} depending on the context. To find out the type name returned by e.Context I suggest that you use Microsoft.VisualBasic.Information.TypeName().

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 07 Feb, 2013 04:10:17 Top
matej golob




Posts: 4
Joined: 2013-01-15
Thanks.
I have handle it now...
Posted 07 Feb, 2013 07:39:21 Top