GefContextMenuItem.Parent (read-only property)

Gets the GefContextMenuItems that is this menu item is a part of.
Syntax: Set GefContextMenuItems = object.Parent
Description: The Parent property will return the GefContextMenuItems collection that is containing this menu item.

Example:

Sub OnMyMenu4
  MsgBox "OnMyMenu4"
End Sub
  
Sub OnMyMenu2
  MsgBox "OnMyMenu2"
End Sub
  
Sub OnPreContextMenu(oContextMenu As GefContextMenu)
  Dim oContextMenuItem0 As GefContextMenuItem
  Dim oContextMenuItem As GefContextMenuItem
  Dim oMenuItems As GefContextMenuItems
  
  Set oMenuItems = oContextMenu.MenuItems
  oMenuItems.RemoveAll
  
  Set oContextMenuItem0 = oMenuItems.Add
   
  oContextMenuItem0.SetActionToScript "OnMyMenu4"
  oContextMenuItem0.Text = "OnMyMenu4"
  oContextMenuItem0.Enabled = False
  
  Set oContextMenuItem = oContextMenuItem0.Parent.Add
  
  oContextMenuItem.SetActionToScript "OnMyMenu2"
  oContextMenuItem.Text = "OnMyMenu2"
  oContextMenuItem.Checked = True
End Sub