expression.DefaultContextMenu As ContextMenu object
where expression is a variable that represents a ContextMenus Object
expression.DefaultContextMenu As ContextMenu object
Public Sub ChangeContextMenu() Dim action As InputMapAction Dim sequence As InputMapActionSequence Dim menuItem As ContextMenuItem Dim OldDefaultMenu As contextMenu Dim MyCustomMenu As contextMenu 'Save the current default menu Set OldDefaultMenu = New contextMenu Set OldDefaultMenu = ThisIbmTerminal.ContextMenus.ItemByName("Default") OldDefaultMenu.Name = "Default Menu" ThisIbmTerminal.ContextMenus.Add OldDefaultMenu 'Create a new menu Set MyCustomMenu = New contextMenu MyCustomMenu.Name = "My Custom Menu" 'Create an action sequence to hold the actions Set sequence = New InputMapActionSequence 'set an action to open the Office Tools Pane and add to the sequence Set action = New InputMapAction action.ActionId = InputMapActionID_OfficeToolsPaneAction sequence.Add action 'create the menu item for the Office Tools action and add it to the sequence Set menuItem = New ContextMenuItem menuItem.Name = "Open Office Tools" menuItem.MenuItemType = ContextMenuItemType_MenuItem Set menuItem.mapping = sequence 'add the Office Tools menu item to the menu MyCustomMenu.AddMenuItem menuItem 'Add the menu ThisIbmTerminal.ContextMenus.Add MyCustomMenu 'Change the default menu Set ThisIbmTerminal.ContextMenus.DefaultContextMenu = MyCustomMenu End Sub