Note: This article pertains to ArcGIS versions 8.x and 9.x. Later versions of ArcGIS may contain different functionality, as well as different names and locations for menus, commands and geoprocessing tools.
This article provides a sample of looping through a text file using ArcObjects.
Note: Support for Visual Basic for Applications (VBA) for ArcMap and ArcCatalog ended with the ArcGIS 10.2.2 release, and Esri has not included VBA compatibility setups since version 10.5. See: ArcGIS Desktop and VBA Moving Forward
Note: For more information on creating a UIControl, see the ArcGIS Desktop Help topic: 'Creating custom commands with VBA and UI Controls'
Dim pMxdoc As IMxDocument Set pMxdoc = ThisDocument Dim pTable As ITable Dim pStandColl As IStandaloneTableCollection Dim pStandTab As IStandaloneTable Set pStandColl = pMxdoc.FocusMap Set pStandTab = pStandColl.StandaloneTable(0) Set pTable = pStandTab Dim pRow As IRow, pCursor As ICursor Set pCursor = pTable.Search(Nothing, False) Set pRow = pCursor.NextRow 'Display a message box for each record Do Until pRow Is Nothing MsgBox pRow.Value(0) & " : " & CStr(pRow.Value(1)) Set pRow = pCursor.NextRow Loop
"CITY","POPULATION" Los Angles,14234953 New York,17834034
Get help from ArcGIS experts
Download the Esri Support App