Removes all the menu items from the menu. | |
Syntax: | object.RemoveAll |
Description: | Removes all the menu items from the context
menu. 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 oContextMenuItem As
GefContextMenuItem Dim oMenuItems As GefContextMenuItems Set oMenuItems =
oContextMenu.MenuItems oMenuItems.RemoveAll Set oContextMenuItem = oMenuItems.Add oContextMenuItem.SetActionToScript
"OnMyMenu2" oContextMenuItem.Text = "OnMyMenu2" oContextMenuItem.Checked = True Set oContextMenuItem = oMenuItems.Add oContextMenuItem.SetActionToScript
"OnMyMenu3" oContextMenuItem.Text = "OnMyMenu3" oContextMenuItem.Enabled = False Set oContextMenuItem = oMenuItems.Add oContextMenuItem.SetActionToScript
"OnMyMenu4" oContextMenuItem.Text = "OnMyMenu4" End Sub |