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
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
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.
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:
You don't have to use VBA to create custom commands and toolbarsin 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
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.