Introduction to Programming ArcObjects with VBA

Overview - In this five-day course students learn the fundamentals of VBA application development, OOP concepts, and the specifics of working with ArcObjects. Participants learn to use VBA development tools including VB editor, customize dialog box, and online help resources. They also learn the syntax for writing simple VB statements, how to write branching and looping structures, and how to design user forms. OOP concepts are described including the advantages of COM in which all ArcObjects classes are based. Interface programming, which may be new to seasoned programmers, is an important aspect of programming with the ArcObjects library and is covered in detail. ArcGIS Desktop software programs (ArcView 8, ArcEditor 8, and ArcInfo 8) share the same architecture, and the knowledge gained in this course applies to all three. Class time is mostly spent doing hands-on programming exercises, where students write code that exposes them to many typical GIS programming tasks as well as to the most commonly used ArcObjects classes. On the last afternoon of the course, participants will have time to work on more advanced programming exercises or to explore ArcObjects on their own. Upon finishing the course, students will have plenty of sample code from which they can build their own applications.

Audience - This course is for those who work with ArcMap and ArcCatalog on a technical level (analysts, programmers, and project managers) but may be new to programming with VBA. It is ideal for users who want to increase productivity by extending ArcGIS applications and for developers who want to create custom applications using VBA.

Goals -
• Customize the GUI
• Learn VBA fundamentals
• Learn OOP concepts
• Get help for writing code
• Navigate the ArcObjects OMD
• Program with ArcMap objects
• Program with ArcCatalog objects
• Program with geodata, display, and geometry objects

Topics Covered -
• VBA development environment: Customizing the user interface; Writing and debugging code
• VB language fundamentals: VB syntax; Code storage; VB functions; Branching and looping; Creating user forms
• OOP concepts: Objects and classes; Class libraries; Methods, properties, and events
• COM: Advantages of COM; Defining a COM class; Interface programming
• Reading OMDs: Class relationships; Class types; Using diagrams to write code
• Maps and layers: Accessing maps and layers; Adding a layer to ArcMap; Classifying and symbolizing layers
• Customizing ArcCatalog: Manipulating f les in the catalog; Defining file types to be displayed
• Working with data: Accessing data sets on disk; Creating new data; Editing data; Applying a domain to a geodatabase field
• Geometry: Creating various types of geometry; Displaying geometry on the display; Storing geometry; Spatial operations
• Spatial and attribute selections: Accessing a user selection; Defining an attribute or spatial query; Processing a subset of records
• Layouts: Programmatically formatting a map layout; Adding elements; Defining symbols and colors for map elements; Accessing items from the ArcMap style gallery
• Creating tools: Getting user input; Transforming mouse input to map unit; Working with the display
• Programming ArcObjects events: Outbound vs. inbound interfaces; Finding events on OMDs; Accessing an object’s outbound interface

Prerequisites and Recommendations - Registrants should have taken Introduction to ArcGIS I (for ArcView, ArcEditor, and ArcInfo), or have equivalent knowledge.  Attendees should be familiar with ArcMap and ArcCatalog.

It is mandatory that registrants gain basic proficiency with VB/VBA before taking this course. Registrants for this course should already know how to:
• Declare and use variables
• Write function and sub procedures
• Use conditional statements (If…Then…Else, Select…Case)
• Work with loops (Do and While loops)
• Create forms, add controls, and write event procedures

Those without the requisite VB/VBA experience can gain proficiency before taking this course in one of the following ways:
• Read and complete the exercises in an introductory VB/VBA text
• Take Introduction to Visual Basic for ESRI Software (Web-based course)
• Take a third party introductory VB/VBA course

Note: This course was formerly titled Programming ArcInfo with Visual Basic for Applications. Students who have taken this class do not need to take this updated version.