How to open the treeview


This tip demonstrates how to open the ArcCatalog treeview to a specific location.

How to use

  1. Paste this macro into VBA.
  2. Update the variable with the location you want to open.
  3. Run this macro.
[VBA]
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