GefContextMenuItem.Enabled (property)

Gets and sets if the menu item is enabled.
Syntax: Boolean = object.Enabled
object.Enabled = Boolean
Description: The Enabled property gets and sets if the menu item is enabled. If Enabled is False the item will be displayed as gray text. The default value of this property is True. You can use this property to disable a native command in the context menu. However if the native command is not normally enabled it can not be enabled by setting this property True.

Example:

Sub OnMyMenu4
  MsgBox "OnMyMenu4"
End Sub
  
Sub OnMyMenu3
  MsgBox "OnMyMenu3"
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