This tip demonstrates how to open the ArcCatalog treeview to a specific location.
How to use
- Paste this macro into VBA.
- Update the variable with the location you want to open.
- Run this macro.
Public Sub opentreeview()
Dim m_sFullName As String
Dim m_pGxCatalog As IGxCatalog
Dim m_pAoGxApp As IGxApplication
'the location to be opened
m_sFullName = "C:\Program Files\ArcGIS\DeveloperKit10.0\Samples\Data\Usa"
Set m_pAoGxApp = Application
Set m_pGxCatalog = m_pAoGxApp.Catalog
m_pGxCatalog.Location = m_sFullName
End Sub