Caption

The Caption property of an OlapMenuItem object contains the caption exposed in the menu for the node in the tree view.

Data Type
String
Example

'Custom add-in

Private Enum MenuActions

  mnuActAddNewForm

  mnuActRefreshForm

  mnuActDeleteForm

End Enum

Private Sub IOlapAddIn_ProvideMenuItems( _

    CurrentNode Ad DSSAddInsManager.OlapTreeNode, _

    MenuItems As DSSAddInsManager.OlapMenuItems)

  On Error Exit Function 'Handle errors

  'MenuItems is a collection for MenuItem objects

  'Some more code...

  'Menu item 'Form' is added as a child of the standard 'New' menu item

  MenuItems.Add mnuStandard, "&Form", mnuActAddNewForm,,mnuflagNew

End Sub

'Later

Private Function IOlapAddIn_ExecuteMenuItem( _

    CurrentNode As DSSAddInsManager.IOlapTreeNode, _

    MenuItem As DSSAddInsManager.IOlapmenuItem) _

    As DSSAddInsManager.RefreshTreeTypes

  On Error GoTo ExecuteMenuItem_Err 'Handle errors

  'some code

  If MenuItem.Caption = "Form" Then

    'code to handle New/Form menu selection

  End If

  Exit Function

ExecuteMenuItem_Err:

  MsgBox "ExecuteMenuItem Failed"

  Err.Clear

End Function

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