MenuItem Method

Returns an instance of the MenuItem object by its index in the menu item collection of the menu.

Applies to: Menu object

Syntax

[[Set] menuItemRet =] object.MenuItem ( index )

The MenuItem method syntax has these parts:

Part Description
object Required. An expression, that returns an instance of the Menu object.
index Required. An expression that returns a Long value. Indicates the index of the menu item in the menu item collection of the menu.
menuItemRet Optional. A MenuItem type variable.

Remarks

If index is less than 1 or greater than the number of the items in the menu, the MenuItem method returns Null. Use the MenuItemsNum method to find out the number of menu items in the menu.

 

See Also

MenuItemsNum method, MenuItem object