GetMasterItem
PowerScript function
Description
Gets the master menu item of the application menu.
Applies to
Syntax
|
1 |
controlname.GetMasterItem ( { Long ParentIndex, } Long Index, ref RibbonMenuItem Item ) |
|
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 obtained; |
|
Index |
The index of the master menu item or submenu item you want |
|
Item |
A RibbonMenuItem variable in which you want to store the |
Return value
Integer.
Returns 1 if it succeeds and -1 if an error occurs. If any
argument’s value is null, returns null.
Usage
The master menu can have no more than two levels.
Examples
This example inserts an “Account” master menu item and an “Account
Settings” submenu item under “Account” and then gets copies of the
“Account” menu and the “Account Settings” submenu.
|
1 2 3 4 5 6 7 8 9 |
Integer li_Return Long ll_Index, ll_Index2 RibbonApplicationMenu lr_AppMenu RibbonMenuItem lr_MenuItem1, lr_MenuItem2 ll_Index = lr_AppMenu.InsertMasterItemLast ("Account", "AccountBig!", "Ue_AccountMenuItemClicked") ll_Index2 = lr_AppMenu.InsertMasterItemLast (ll_Index, "Account Settings", "AccountSettingsBig!", "Ue_AccountSettingsClicked") li_Return = lr_AppMenu.GetMasterItem (ll_Index, lr_MenuItem1) li_Return = lr_AppMenu.GetMasterItem (ll_Index, ll_Index2, lr_MenuItem2) |
See also