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 illustrates how to activate one of the ArcMap edit tools programmatically.
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 pCmdBars As ICommandBars Dim pEditBar As ICommandBar Dim pCmdItem As ICommandItem Dim pEditTool As ICommandItem Set pCmdBars = ThisDocument.CommandBars ' Some of the Edit Tools. ' This is the tool that you will use for this sample. Set pEditTool = pCmdBars.Find(ArcID.Editor_DistanceDistance) ' Experiment with some of the remaining tools. ' The Editor SketchTool is the default. ' ***** ArcID.Editor_SketchTool ' Other tools ' ***** ArcID.Editor_IntersectionTool ' ***** ArcID.Editor_Arc Set Application.CurrentTool = pEditTool