RemoveMenuItemByCmdID Method

Removes the menu item with the specified ID (the CmdID property). Returns the number of menu item, remaining in the menu after the operation.

Applies to: Menu object

Syntax

[[Let] countRet =] object.RemoveMenuItemByCmdID ( mItemCmdID )

The RemoveMenuItemByCmdID 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. Indicates the ID (the CmdID property) of the menu item to be removed.

countRet Optional. A Long type variable.

Remarks

If the menu item with the specified mItemCmdID was not found in the menu item collection of the menu, the RemoveMenuItemByCmdID method doesn't remove anything.