Sub ExpandSelecetdTreeNode()
Dim gxApplication As IGxApplication
Set gxApplication = Application
Dim gxTreeView As IGxTreeView
Set gxTreeView = gxApplication.TreeView
Dim gxView As IGxView
Set gxView = gxTreeView
'If you want to select the location.
gxApplication.Location = "C:\Users\Administrator\Documents\ArcGIS"
Dim gxSelectedContainer As IGxObjectContainer
Set gxSelectedContainer = gxApplication.SelectedObject
Dim gxObjects As IEnumGxObject
Set gxObjects = gxSelectedContainer.Children
If gxObjects Is Nothing Then Exit Sub
gxObjects.Reset
Dim gxChildObject As IGxObject
Set gxChildObject = gxObjects.Next
Dim gxSelection As IGxSelection
Set gxSelection = New gxSelection
Call gxSelection.SetLocation(gxChildObject, Nothing)
Call gxSelection.Select(gxChildObject, False, Nothing)
Call gxTreeView.EnsureVisible(gxChildObject)
Call gxView.Refresh
End Sub