Add (OlapTreeNodes)

Analysis Services Programming

Analysis Services Programming

Add (OlapTreeNodes)

The Add method of the OlapTreeNodes collection adds a new OlapTreeNode object to the collection. This method returns an object of type OlapTreeNode.

Syntax

Set vnt = object.Add(Caption As String, IconClosed As Integer, [IconOpen As Integer])

vnt

An instance of OlapTreeNode that receives the instance of the new member.

object

An instance of the OlapTreeNodes collection.

Caption

The string value to be displayed for the tree node.

IconClosed

The index of the icon resource displayed when the tree node is collapsed.

IconOpen

(Optional)The index of the icon resource displayed when the tree node is expanded.

Remarks

The Add method is used to populate the OlapTreeNodes collection with child nodes that are displayed in the tree. Call this method for each OlapTreeNode object you want to add.

Example
Private Enum NodeIcons
  icoNode1 = 1
  icoNode2
  icoNode3
End Enum

Private Sub IOlapAddIn_ProvideChildNodes( _
    ParentNode As DSSAddInsManager. OlapTreeNode, _
    OlapTreeNodes As DSSAddInsManager.OlapTreeNodes)
  On Error GoTo ProvideChildNodes_Err 'Handle errors
  
  If ParentNode.Caption = "Analysis Servers" Then
    OlapTreeNodes.Add "Node 1", icoNode1
    OlapTreeNodes.Add "Node 2", icoNode2
    OlapTreeNodes.Add "Node 3", icoNode3
  End If
  
  Exit Sub
ProvideChildNodes_Err:
  Debug.Print Err.Number, Err.Description, Err.Source
  Debug.Assert False
  MsgBox "ProvideChildNodes Failed"
  Err.Clear
End Sub

See Also

OlapTreeNodes Collection