GefContextMenuItem.SubMenu (read-only property)

Gets the GefContextMenu that this menu item contains.
Syntax: Set GefContextMenuItem = object.SubMenu
Description: The SubMenu property will return the GefContextMenuItem that contains the menu items that make up this submenu. This property will return "Nothing" if the Type is not "gefMenuItemTypeSubMenu". To make a menu item a SubMenu call MakeSubmenu.

Example:

Sub OnPreContextMenu(oContextMenu As GefContextMenu)
  
  Dim oContextMenuItem As GefContextMenuItem
  Dim oMenuItems As GefContextMenuItems
  
  Set oMenuItems = oContextMenu.MenuItems
  
  Set oContextMenuItem = oMenuItems.Add
  
  oContextMenuItem.MakeSubMenu
  
  oContextMenuItem.Text = "Custom procedure menu items"
  
  Dim oSubMenu As GefContextMenu
  
  Set oSubMenu = oContextMenuItem.SubMenu
  
  Dim oSubMenuItem As GefContextMenuItem
  Set oSubMenuItem = oSubMenu.MenuItems.Add
  oSubMenuItem.SetActionToProcedure "OnMyProcMenu1"
  oSubMenuItem.Text = "OnMyMenu1"
  oSubMenuItem.Checked = True
  oSubMenuItem.Translated = False
  
End Sub