AddMenuItem Method

Adds a popup menu item to a popup menu.

See Also | Example

Signature

RetVal = object.AddMenuItem(Index, Label, Macro)

Object

PopupMenu
The object or objects this method applies to.

Index

Variant; input-only
The index location in the popup menu where the item is to be added. The index must be either an integer or a string.

If an integer is supplied to specify a given location in the menu, the index must be between 0 and N-1, where N is the number of objects in the popup menu. The new item will be added immediately before the specified index location. To add the new menu item to the end of a menu, set the index to be greater than N.

If a string is specified and the indexed item does not exist, then the new menu item is added at the end of the menu.

Label

String; input-only
The label for the menu item. The label may contain DIESEL string expressions. Labels also identify the accelerator keys (keyboard key sequences) that correspond to the menu item by placing an ampersand (&) in front of the accelerator character.

Macro

String; input-only
The name of the macro associated with this menu item.

RetVal

PopupMenuItem object
The newly created popup menu item.

 

   Comments?