Getting started developing for ArcGIS Desktop  

What can you do?

This topic is relevant for the following:
Product(s): ArcGIS Desktop: All
Version(s): 9.1, 9.2
Language(s): C#, VB6, VB.NET, VC++
Experience level(s): New to ArcGIS development



In this topic

  1. Customizing ArcGIS Desktop applications
  2. Writing VBA macros
  3. Writing custom components

Customizing ArcGIS Desktop applications

You may want the ArcMap and ArcCatalog interfaces to reflect your own preferences and the way you work.

You can customize ArcMap and ArcCatalog in many ways. Here are some examples:

If you work in a larger organization, others may want you to develop a customized work environment for them. You can handle many customization tasks without writing a single line of code. In fact, you may be able to instruct others on how to use the customization environment to create the look and feel they want on their own. You can change or create toolbars, menus, shortcut keys, and so on, to help you do your work in the most efficient way. You can provide additional functionality by linking code you or others have written to menu commands or tools.

Several toolbars are provided with ArcMap and ArcCatalog, but you may want to create new toolbars to organize commands that you often use together or to contain buttons that run your custom scripts.



The Customize dialog box is used to create new toolbars and add or remove controls.

Writing VBA macros in ArcGIS applications

Both ArcMap and ArcCatalog come with Visual Basic® for Applications (VBA). VBA is not a standalone program; it's embedded in the applications. It provides an integrated programming environment, the Visual Basic Editor (VBE), which lets you write a Visual Basic (VB) macro, then debug and test it right away in ArcMap or ArcCatalog. A macro can integrate some or all of VB's functionality, such as using message boxes for input, with the extensive object library that ArcMap and ArcCatalog expose. The ESRI object libraries are always available to you in the VBA environment.

There is an easy way to create custom commands with VBA. You can create a new button, tool, combo box, or edit box (collectively called UIControls), then attach code to the control's events, such as what happens when you click a button. After you have created it, you can drag this new control onto a toolbar.


A buffer command created in VBA

As mentioned, you should start development by using the VBA environment in one of the existing ArcGIS applications. VBA is a simple programming language with many utilities, such as design time code completion and the Object Browser that will help you assemble code quickly.

Here are more reasons to choose the VBA environment:

Writing custom components to extend the ArcGIS Desktop applications

You don't have to use VBA to create custom commands and toolbars—in fact, in some cases, your custom commands and toolbars may require you to use another development environment. You can create custom objects in any programming language that supports the Microsoft® Component Object Model. Custom commands or toolbars created outside VBA are often distributed as ActiveX DLLs. If you have created some custom commands and toolbars, or someone else has given you an ActiveX DLL containing custom commands and toolbars, you can easily add these objects to ArcMap or ArcCatalog. After adding a custom object to ArcMap or ArcCatalog, you can use it as you would any built-in command or toolbar.

If you want to use a programming language other than VBA, or if you want to package ArcObjects functionality into a COM DLL, EXE, OCX, or .NET assembly, you will have to work outside the VBA development environment. This approach generally requires creating a project, referencing the ArcObjects type libraries required, implementing ArcObjects interfaces, adding code, then compiling the source into a binary file.

Following are some advantages of building custom components:

Components can be broadly categorized into two areas of customization: those that reside at the application level, such as custom buttons, toolbars, windows, and extensions, and those that reside at the geodatabase level, such as custom feature class extensions and features. Some of these more advanced customizations cannot be accomplished through the VBA environment.


The Production Line Tool Set (PLTS) is an example of a complex application extension created with ArcObjects.