The Add method of the OlapMenuItems collection adds a new OlapMenuItem object to the collection.
Add(MenuType As OlapMenuTypes, [Caption As String], [Key As Long], [ParentKey As Long], [Flags As OlapMenuFlags]) As OlapMenuItem
OlapMenuItem
The Add method is used to populate the OlapMenuItems collection with menu items to be displayed when the user right-clicks a tree node. Call this method for each menu item you want to add.
Private Enum MenuActions
mnuActTop
mnuActMid
mnuActBtm
mnuActSpc
End Enum
Private Sub IOlapAddIn_ProvideMenuItems(CurrentNode As DSSAddInsManager.OlapTreeNode, MenuItems As DSSAddInsManager.OlapMenuItems)
On Error GoTo ProvideMenuItems_Err 'Handle errors
If CurrentNode.Caption = "Node 1" Then
'Enable default New menu item and add child menu items
MenuItems.Add mnuStandard, "&Top", mnuActTop, , mnuflagNew
MenuItems.Add mnuStandard, "&Mid", mnuActMid, , mnuflagNew
MenuItems.Add mnuStandard, "&Btm", mnuActBtm, , mnuflagNew
'Add regular menu item to root menu
MenuItems.Add mnuStandard, "&Special", mnuActSpc, , mnuflagRegular
End If
Exit Sub
ProvideMenuItems_Err:
MsgBox "ProvideIcon failed"
Err.Clear
End Sub