Adding and Displaying Shortcut Menus
A shortcut menu is a floating command bar that the user displays by right-clicking. It can contain the same control types as a command bar, and the controls behave in the same way as on a command bar. In most applications, however, you cannot create or modify shortcut menus from the application's interface. Therefore, you need to create and modify your shortcut menus at run time.
Adding shortcut menus at run time
The only difference between shortcut menus and other toolbars is that when you create the shortcut menu with the Add method, you must specify msoBarPopUp as the Position argument. The following example creates a new shortcut menu, adds two controls (with captions) to it, and then uses the ShowPopup method to display the new menu.
Displaying shortcut menus
Use the ShowPopup method to display shortcut menus, as demonstrated in the preceding example.
If the container application supports assigning event procedures to user actions, you can display a shortcut menu in response to a right-click event. However, not all applications support event procedures. Check the documentation for your container application to see whether the application supports event procedures.
Making run-time modifications to shortcut menus
Any changes you make to a shortcut menu must be made at run time, and the changes you make will generally be limited to changing the appearance or action of the controls on the menu.