GetMasterItemCount
PowerScript function
Description
Determines the total number of the master menu items in the
application menu.
Applies to
Syntax
|
1 |
controlname.GetMasterItemCount ( { Long ParentIndex } ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the RibbonApplicationMenu control |
|
ParentIndex (optional) |
The index of the master menu item (RibbonMenuItem) whose If not specified, the master menu items will be counted; |
Return value
Long.
Returns the total number of menu items in the master menu. If the
master menu contains no items, returns 0. If an error occurs, returns -1.
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 and then inserts two
submenu items “Account Settings” and “Sign Out” under “Account”, and then
counts the number of the submenu items (which returns 2) and the master
menu item (which returns 1).
|
1 2 3 4 5 6 7 8 |
Long ll_Index, ll_Index2, ll_Count RibbonApplicationMenu lr_AppMenu ll_Index = lr_AppMenu.InsertMasterItemLast ("Account", "AccountBig!", "Ue_AccountMenuItemClicked") ll_Index2 = lr_AppMenu.InsertMasterItemLast (ll_Index, "Account Settings", "AccountSettingsBig!", "Ue_AccountSettingsBigClicked") ll_Index2 = lr_AppMenu.InsertMasterItemLast (ll_Index, "Sign Out", "SignOutBig!", "Ue_SignOutClicked") ll_Count = lr_AppMenu.GetMasterItemCount (ll_Index) ll_Count = lr_AppMenu.GetMasterItemCount() |
See also