HOW TO
This article contains a code sample that shows how to change the selection in ArcCatalog using VBA.
Code:
Sub ChangeSelectionInArcCatalog()
Dim pGApp As IGxApplication
Dim pGxSel As IGxSelection
Dim pEnumGxObj As IEnumGxObject
Dim pGxObj As IGxObject
Dim ln As Long
Set pGApp = Application
'Specify the file that is to be selected
'In this case it is a personal geodatabase table
Set pGxObj = pGApp.Catalog.GetObjectFromFullName _
("c:\testing\table.mdb\accidentdata", ln)
Set pGxSel = pGApp.Selection
pGxSel.SetLocation pGxObj, Nothing
'Refresh the catalog.
'By setting the path it will only refresh that folder
pGApp.Refresh "c:\testing"
End Sub
Article ID:000006286
Get help from ArcGIS experts
Download the Esri Support App