For Each o As object In ContextMenus("Cell").Items
output.show(o.name)
Dim pi As System.Reflection.PropertyInfo = ContextMenus("Cell").Items(o.name).Gettype().GetProperty("Items")
If pi IsNot Nothing Then
output.show("有子菜单-----------")
For Each ob As object In ContextMenus("Cell").Items(o.name).Items
output.show(ob.name)
Next
End If
output.show("-----------")
Next
以上是解决方案,可以写成递归就可以遍历一直判断下级是否有子节点了