DeleteMasterItem
PowerScript function
Description
Removes a master menu item from the application menu.
Applies to
Syntax
|
1 |
controlname.DeleteMasterItem ( { Long ParentIndex, } Long Index ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the RibbonApplicationMenu control from which |
|
ParentIndex (optional) |
The index of the master menu item (RibbonMenuItem) whose If not specified, the master menu item will be deleted; if |
|
Index |
The index of the master menu item or submenu item which you want to delete. If index is invalid, an error would occur and this operation would return -1. |
Return value
Integer.
Returns the number of items remaining in the list of values after
the item is deleted if it succeeds and -1 if an error occurs. If any
argument’s value is null, returns null.
Examples
This example inserts a “MenuItem1” master menu item and a
“SubMenuItem1” submenu item and then deletes them according to their index
number.
|
1 2 3 4 5 6 7 8 9 10 11 |
Long ll_Return,ll_Index,ll_Index2 RibbonApplicationMenu lr_AppMenu RibbonMenuItem lr_MenuItem1,lr_MenuItem2 lr_MenuItem1.Text = "MenuItem1" lr_MenuItem2.Text = "SubMenuItem1" ll_Index = lr_AppMenu.InsertMasterItemLast(lr_MenuItem1) ll_Index2 = lr_AppMenu.InsertMasterItemLast(ll_Index,lr_MenuItem2) ll_Return = lr_AppMenu.DeleteMasterItem(ll_Index,ll_Index2) ll_Return = lr_AppMenu.DeleteMasterItem(ll_Index) |
See also