Makes the menu item run a script if selected | |
Syntax: | Boolean = object.SetActionToScript ( ScriptEntryPoint, UserParamater ) |
Parameters: |
ScriptEntryPoint As String - The name of an existing script
entry point
Optional UserParamater As String - An optional user paramater
|
Description: | The SetActionToUserScript method makes the
menu item run a previously defined script entry point when it is
selected. The entry point must exist in the Parent object of the GefContextMenu or one of the container
objects of that object. Example: Sub OnMyMenu4 MsgBox "OnMyMenu4" End Sub Sub OnMyMenu3 MsgBox "OnMyMenu3" End Sub Sub OnMyMenu2 MsgBox "OnMyMenu2" End Sub Sub OnMyMenu1 MsgBox "OnMyMenu1" End Sub 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 script menu
items" Dim oSubMenu As GefContextMenu Set oSubMenu =
oContextMenuItem.SubMenu Dim oSubMenuItem As GefContextMenuItem Set oSubMenuItem =
oSubMenu.MenuItems.Add oSubMenuItem.SetActionToScript
"OnMyMenu1" oSubMenuItem.Text = "OnMyMenu1" oSubMenuItem.Checked = True oSubMenuItem.Translated = False End Sub |