Add Menu Items to "right click" context menu in MSProject 2002

K

Kirk

I am looking for information on how to add menu items to the context menu
that you get in a Gant chart when right clicking. I have interrogated the
menu structure with VBA but can not find a commandbar that relates to the
context menu. I can does this Excel for example very easily, but can only
find the menu structure for the "main menu" command bar.

Any help would be appreciated.

Thanks,
Kirk
 
K

Kirk

Thanks for the response.

Adding menu items to a shortcut menu is very easy in Excel, as I think most
people know. That was the basic model that I was following/looking for in
MSProject. As both of our experiences seem to confirm, this particular menu
structure is not progammically available to add menu items into within the
MSProject environment.

I have been able to progammatically build, display and traverse a substitute
shortcut menu in MSProject 2002/2000 after the user executes some action;
that is, I can display my shortcut menu instead of the default MSProject
shortcut menu for the given context utilizing the various MSProject events
suchs as "BeforeTaskNew". I can even do this dynamically based upon content
in a particular field of a record in a Gantt chart, for example. This is all
done with the standard CommandBar family of objects with the parent menu
defined as a msoBarPopup.

The last challenge that I have run into is that MSProject will not execute
the associated procedure specified in the "OnAction" property of a menu item
defined as a msoControlButton. It just quietly returns after selecting the
menu item . The exact same definition in a popup defined and inserted in the
"Menu Bar", the conventional menu presented across the top of MSProject,
works fine.

I have experimented from a number of perspectives assuming that it may be
scope/name resolution issue, but without success. Apparently MSProject is
not wired to examine this property and dispatch the call.

My next idea was to see if the MSProject "menu handler/dispatcher" left a
clue as to the selected item in some global variable that I could use to
select a procedure after the ShowPopup. No luck so far.

There are clues/evidence of this problem scattered around the web. In
particular, MSDN talks about an almost identical problem in Office 2003 with
the recommendation to make the "tag" property a unique string. One fact that
seems to confirm the "not wired" idea is that MSDN article talked about
needing a "withevents" on the button declaration.

Another approach to this is to make a custom user dialog that looks and acts
like a menu. You can capture mouse events with the Windows API and map to
procedures accordingly . . . a lot of work for menus.

Kirk
 

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