Flags (OlapMenuItem)

Analysis Services Programming

Analysis Services Programming

Flags (OlapMenuItem)

The Flags property of an OlapMenuItem object determines the state of the menu item, such as whether the item is enabled, the place of the item in the menu hierarchy, and so on.

Data Type

Integer representing a bitmask of constants in the OlapMenuFlags enumeration.

Access

Read/write

Remarks

Values can be combined from the OlapMenuFlags enumeration using a bitwise OR operator.

Example

The following example adds a menu item, marks it as new, and ensures that it is unchecked:

'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 GoTo ProvideMenuItems_Err '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 + NOT mnuflagChecked
  Exit Sub
ProvideMenuItems_Err:
  MsgBox "ProvideMenuItems Failed"
  Err.Clear
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
  If MenuItem.Flag AND NOT mnuflagChecked Then
    'menu item unchecked, execute code
  End If
  Exit Function
ExecuteMenuItem_Err:
  MsgBox "ExecutemenuItem Failed"
  Err.Clear
End Function

See Also

OlapMenuFlags

OlapMenuItem