MenuItemByCmdID Method

Returns an instance of the MenuItem object by the specified ID of the menu item (the CmdID property) from the menu item collection of the menu.

Applies to: Menu object

Syntax

[[Set] menuItemRet =] object.MenuItemByCmdID ( mItemCmdID )

The MenuItemByCmdID method syntax has these parts:

Part Description
object Required. An expression, that returns an instance of the Menu object.
mItemCmdID Required. An expression that returns a Long value. Represents the ID of the menu item being searched.
menuItemRet Optional. A MenuItem type variable.

Remarks

If there is no menu item with the specified mItemCmdID, the MenuItemByCmdID method returns Nothing.