The ParentKey property of an OlapMenuItem object contains the key of the parent of the item.
The parent key value is used to associate a child menu item with a parent or owner pop-up menu item.
Private Enum PopupItems
mnuPopSpecial
mnuPopAverage
mnuPopPoor
End Enum
Private Enum MenuActions
mnuAddNew
mnuRefresh
mnuDelete
End Enum
Private Sub IOlapAddIn_ProvideMenuItems( _
CurrentNode Ad DSSAddInsManager.OlapTreeNode, _
MenuItems As DSSAddInsManager.OlapMenuItems)
On Error GoTo ProvideMenuItems_Err 'Handle errors
'MenuItems is a collection for MenuItem objects
'Some more code
'"Special" is displayed on the root menu as a pop-up
'"New", "Refresh", and "Delete" are items on Special's child menu
'flagged by the mnuPopSpecial enumeration
MenuItems.Add mnuStandard, "&Special", mnuPopSpecial, , _
mnuflagRegular + mnuflagPopup
MenuItems.Add mnuStandard, _
"&New", mnuAddNew, mnuPopSpecial, mnuflagSubmenu
MenuItems.Add mnuStandard, _
"&Refresh", mnuRefresh, mnuPopSpecial, mnuflagSubmenu
MenuItems.Add mnuStandard, _
"&Delete", mnuDelete, mnuPopSpecial, mnuflagSubmenu
Exit Sub
ProvideMenuItems_Err:
MsgBox "ProvideMenuItems Failed"
Err.Clear
End Sub