The ProvideMenuItems method of the IOlapAddIn interface responds to a request that the add-in program enable default menu items, add new menu items to the current node, or both.
ProvideMenuItems(CurrentNode As OlapTreeNode, _
MenuItems As OlapMenuItems)
The ProvideMenuItems function is used to enable default menu items and to add new menu items to the current tree node. When your add-in program enables default menu items, it should also provide associated child menu items.
Note Enumerations provided for menu items and menu actions should be initialized with a positive, non-zero value. Enumerations initialized to zero may cause unpredictable results when providing menu items for a custom add-in program.
Private Enum MenuActions
mnuActTop = 1
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 "ProvideMenuItems failed"
Err.Clear
End Sub