ExecuteMenuItem

The ExecuteMenuItem method of the IOlapAddIn interface is called when the user clicks a menu item. Provide code in this method to respond to the user’s actions.

Syntax

Function ExecuteMenuItem(CurrentNode As OlapTreeNode, MenuItem As OlapMenuItem) As RefreshTreeTypes

Calling Arguments
CurrentNode
The node that is currently selected in the tree view.
MenuItem
The menu item that the user clicked.
Returns

A member of the RefreshTreeTypes enumeration.

Remarks

By querying the properties of the CurrentNode and MenuItem objects, your application can determine which menu item the user clicked and respond accordingly.

Example

Private Function IOlapAddIn_ExecuteMenuItem( _

    CurrentNode As DSSAddInsManager.OlapTreeNode, _

    MenuItem As DSSAddInsManager.OlapMenuItem) _

    As DSSAddInsManager.RefreshTreeTypes

  On Error GoTo ExecuteMenuItem_Err 'Handle errors

  Select Case CurrentNode.Caption

    Case "Add"

      Select Case MenuItem.Key

        Case mnuactAddItem1

          'Code to add item 1

        Case mnuactAddItem2

          'Code to add item 2

        Case mnuactAddItem3

          'Code to add item 3

      End Select

 

    Case "Edit"

      Select Case MenuItem.Key

        Case mnuactEditItem1

          'Code to edit item 1

        Case mnuactEditItem1

          'Code to edit item 2

        Case mnuactEditItem1

          'Code to edit item 3

      End Select

  End Select

 

  Exit Function

ExecuteMenuItem_Err:

  MsgBox "ExecuteMenuItem Failed"

  Err.Clear

End Function

(c) 1988-1998 Microsoft Corporation. All Rights Reserved.