Open 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.
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 = "D:\arcgis\arcexe83\ArcObjects Developer Kit\Samples\Data\canada"

  Set m_pAoGxApp = Application
  Set m_pGxCatalog = m_pAoGxApp.Catalog
  m_pGxCatalog.Location = m_sFullName
End Sub