'取得treeModel对象和根节点对象
Set treeModel = treeObject.object.getModel()
set roottNode = treeModel.getRoot()
'得到子孙节点的方法
childCount = CInt(treeModel.getChildCount(curParentNode))
For childIndex = 0 to childCount-1
Set childNode = treeModel.getChild(curParentNode, childIndex)
Next
'判断树的类别
toolkitClass = treeObject.GetROProperty("toolkit class")
If InStr(toolkitClass, "IlpTree") > 0 Then
treeType = "IlpTree"
ElseIf InStr(toolkitClass, "UTreeView$UExplorerTree") > 0 Then
treeType = "ExplorerTree"
Else
treeType = "JTree"
End If
'根据树的类别,得到节点的名称
If treeType ="IlpTree" Then
childNodeName = childNode.getIlpObject().getLabel()
ElseIf treeType="ExplorerTree" Then
childNodeName = childNode.getNode.getDisplayName()
Else
childNodeName = childNode.getUserObject().toString()
End If