0% found this document useful (0 votes)
3 views

Introduction To Programming Arcobjects With Vba Jeremiah Lindemann pdf download

The document is a comprehensive guide to programming ArcObjects using VBA, detailing course objectives, materials, and a structured timeline for learning. It covers the VBA development environment, object-oriented programming, and various programming concepts such as variables, classes, and data access. Additionally, it includes exercises to reinforce learning and practical applications within the ArcGIS software framework.

Uploaded by

cognrtg291
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Introduction To Programming Arcobjects With Vba Jeremiah Lindemann pdf download

The document is a comprehensive guide to programming ArcObjects using VBA, detailing course objectives, materials, and a structured timeline for learning. It covers the VBA development environment, object-oriented programming, and various programming concepts such as variables, classes, and data access. Additionally, it includes exercises to reinforce learning and practical applications within the ArcGIS software framework.

Uploaded by

cognrtg291
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 86

Introduction To Programming Arcobjects With Vba

Jeremiah Lindemann download

https://ebookbell.com/product/introduction-to-programming-
arcobjects-with-vba-jeremiah-lindemann-2228306

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Introduction To Programming With Fortran 4th Edn Ian Chivers Jane


Sleightholme

https://ebookbell.com/product/introduction-to-programming-with-
fortran-4th-edn-ian-chivers-jane-sleightholme-49848242

Introduction To Programming With C 3rd International Edition 3rd Y


Daniel Liang

https://ebookbell.com/product/introduction-to-programming-with-c-3rd-
international-edition-3rd-y-daniel-liang-55234740

Introduction To Programming C Chopra Rajiv

https://ebookbell.com/product/introduction-to-programming-c-chopra-
rajiv-56597050

Introduction To Programming With Java 3rd Edition John Dean Ray Dean

https://ebookbell.com/product/introduction-to-programming-with-
java-3rd-edition-john-dean-ray-dean-58035934
Introduction To Programming Languages Programming In C C Scheme Prolog
C And Soa Fifth Edition Yinong

https://ebookbell.com/product/introduction-to-programming-languages-
programming-in-c-c-scheme-prolog-c-and-soa-fifth-edition-
yinong-21889502

Introduction To Programming With Greenfoot Objectoriented Programming


In Java With Games And Simulations Klling

https://ebookbell.com/product/introduction-to-programming-with-
greenfoot-objectoriented-programming-in-java-with-games-and-
simulations-klling-21995800

Introduction To Programming Using Python Daniel Y Liang

https://ebookbell.com/product/introduction-to-programming-using-
python-daniel-y-liang-22039592

Introduction To Programming With C For Engineers 1st Edition Boguslaw


Cyganek

https://ebookbell.com/product/introduction-to-programming-with-c-for-
engineers-1st-edition-boguslaw-cyganek-22898364

Introduction To Programming In C Language C Programming Best C


Programming Language Book For Beginners Khachane

https://ebookbell.com/product/introduction-to-programming-in-c-
language-c-programming-best-c-programming-language-book-for-beginners-
khachane-23917738
Introduction to
Programming
ArcObjects with VBA
(Final)

Jeremiah Lindemann
Lisa Markham
Robert Burke
Janis Davis
Thad Tilton
Copyright © 2001–2004 ESRI
All rights reserved.
Course version 3.2. Revised July 2004.
Printed in the United States of America.

The information contained in this document is the exclusive property of ESRI. This work is protected under United States
copyright law and the copyright laws of the given countries of origin and applicable international laws, treaties, and/or
conventions. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical,
including photocopying or recording, or by any information storage or retrieval system, except as expressly permitted in writing by
ESRI. All requests should be sent to Attention: Contracts Manager, ESRI, 380 New York Street, Redlands, CA 92373-8100, USA.

The information contained in this document is subject to change without notice.

U. S. GOVERNMENT RESTRICTED/LIMITED RIGHTS


Any software, documentation, and/or data delivered hereunder is subject to the terms
of the License Agreement. In no event shall the U.S. Government acquire greater
than RESTRICTED/LIMITED RIGHTS. At a minimum, use, duplication, or
disclosure by the U.S. Government is subject to restrictions as set forth in FAR
§52.227-14 Alternates I, II, and III (JUN 1987); FAR §52.227-19 (JUN 1987) and/or
FAR §12.211/12.212 (Commercial Technical Data/Computer Software); and DFARS
§252.227-7015 (NOV 1995) (Technical Data) and/or DFARS §227.7202 (Computer
Software), as applicable. Contractor/Manufacturer is ESRI, 380 New York Street,
Redlands, CA 92373-8100, USA.

ESRI, ARC/INFO, ArcCAD, ArcGIS, ArcIMS, ArcPad, ArcSDE, ArcView, BusinessMAP, MapObjects, PC ARC/INFO, SDE,
and the ESRI globe logo are trademarks of Environmental Systems Research Institute, Inc., registered in the United States and
certain other countries; registration is pending in the European Community. 3D Analyst, ADF, ArcCOGO, the ArcCOGO logo,
ArcGrid, the ArcGrid logo, the ARC/INFO logo, AML, ArcNetwork, the ArcNetwork logo, ArcNews, ArcTIN, the ArcTIN logo,
ArcInfo, the ArcInfo logo, ArcInfo Librarian, ArcInfo—Professional GIS, ArcInfo—The World's GIS, ArcAtlas, the ArcAtlas
logo, the ArcCAD logo, the ArcCAD WorkBench logo, ArcCatalog, the ArcData logo, the ArcData Online logo, ArcDoc, ArcEdit,
the ArcEdit logo, ArcEurope, the ArcEurope logo, ArcEditor, ArcExplorer, the ArcExplorer logo, ArcExpress, the ArcExpress
logo, ArcFM, the ArcFM logo, ArcFM Viewer, the ArcFM Viewer logo, ArcGlobe, the ArcIMS logo, ArcLocation, ArcLogistics,
the ArcLogistics Route logo, ArcMap, ArcObjects, the ArcPad logo, Arcplot, the Arcplot logo, ArcPress, the ArcPress logo, the
ArcPress for ArcView logo, ArcReader, ArcScan, the ArcScan logo, ArcScene, the ArcScene logo, ArcSchool, the ArcSDE logo,
the ArcSDE CAD Client logo, ArcSdl, ArcStorm, the ArcStorm logo, ArcSurvey, ArcToolbox, ArcTools, the ArcTools logo,
ArcUSA, the ArcUSA logo, ArcUser, the ArcView GIS logo, the ArcView 3D Analyst logo, the ArcView Business Analyst logo,
the ArcView Data Publisher logo, the ArcView Image Analysis logo, the ArcView Internet Map Server logo, the ArcView
Network Analyst logo, the ArcView Spatial Analyst logo, the ArcView StreetMap logo, the ArcView StreetMap 2000 logo, the
ArcView Tracking Analyst logo, ArcVoyager, ArcWorld, the ArcWorld logo, Atlas GIS, the Atlas GIS logo, AtlasWare, Avenue,
the Avenue logo, the BusinessMAP logo, DAK, the DAK logo, Database Integrator, DBI Kit, the Digital Chart of the World logo,
the ESRI Data logo, the ESRI Press logo, ESRI—Team GIS, ESRI—The GIS People, FormEdit, Geographic Design System,
Geography Matters, GIS by ESRI, GIS Day, the GIS Day logo, GIS for Everyone, GISData Server, InsiteMAP, MapBeans,
MapCafé, the MapCafé logo, the MapObjects logo, the MapObjects Internet Map Server logo, ModelBuilder, MOLE, the MOLE
logo, NetEngine, the NetEngine logo, the PC ARC/INFO logo, PC ARCEDIT, PC ARCPLOT, PC ARCSHELL, PC DATA
CONVERSION, PC NETWORK, PC OVERLAY, PC STARTER KIT, PC TABLES, the Production Line Tool Set logo,
RouteMAP, the RouteMAP logo, the RouteMAP IMS logo, Spatial Database Engine, the SDE logo, SML, StreetEditor, StreetMap,
TABLES, The World's Leading Desktop GIS, Water Writes, and Your Personal Geographic Information System are trademarks;
and ArcData, ArcOpen, ArcQuest, ArcWatch, ArcWeb, Rent-a-Tech, Geography Network, the Geography Network logo,
www.geographynetwork.com, www.gisday.com, @esri.com, and www.esri.com are service marks of ESRI.
The names of other companies and products herein are trademarks or registered trademarks of their respective trademark owners.
ArcView GIS uses HCL Technologies Ltd. Presenter software under license.
C O N T E N T S

1 Introduction to Programming ArcObjects with VBA


Welcome to Intro to Programming ArcObjects 1-2
Logistics 1-3
Course materials 1-4
Course objectives 1-5
Course timeline 1-6
What is ArcGIS? 1-7
Software support resources 1-8
Learning paths 1-9
VBA: Visual Basic for Applications 1-11
What can ArcObjects do? 1-12
Exercise options 1-16
Exercise typographic conventions 1-17
Exercise 1 overview 1-19
Exercise 1: Install the class database

2 The VBA development environment


Lesson overview 2-2
The VBA development environment 2-3
ArcGIS commands 2-4
Using the Customize dialog box 2-5
The Customize dialog 2-6
Using the Customize dialog box 2-8
Creating a new command 2-9
Setting control properties 2-10
Accessing your customizations 2-11
Storing your customizations 2-13
Examining a control’s source code 2-14
Demonstration 2-15
Overview 2-16
The Visual Basic Editor 2-17
Understanding ArcMap software’s code storage 2-19
Writing Visual Basic statements 2-20
Some common Visual Basic functions 2-21
Procedure types 2-23
Running an event procedure 2-24

Copyright © 2001–2004 ESRI i


Introduction to Programming ArcObjects with VBA Contents

Navigating event procedures in a module 2-25


The ThisDocument module 2-26
Creating a new module 2-27
Creating a new sub or function procedure (macro) 2-28
Defining procedure scope 2-30
Running a subroutine or function procedure 2-31
Adding a macro to a toolbar 2-32
Getting help 2-33
Exercise 2 overview 2-34
Exercise 2: Explore the Visual Basic Editor

3 Visual Basic code: How, where, and when?


Lesson overview 3-2
Object-oriented programming 3-3
Example: Object-oriented terms 3-4
How: Visual Basic syntax 3-5
Preset ArcObjects variables 3-7
Automatic code completion 3-9
Where: Controls, documents, and forms 3-11
Working with forms 3-13
Setting properties at design time 3-14
Writing code for a form 3-16
Using control properties at run time 3-17
When: Form and control events 3-18
When: Map document events 3-20
Saving your work 3-22
Exercise 3 overview 3-23
Exercise 3: Create a user form

4 Using variables
Lesson overview 4-2
Variables 4-3
Working with variables 4-4
Dim (dimension) statement 4-6
Assigning a value to a variable 4-8
Function procedures 4-10
Comparing values 4-12
Decision making: The If Then statement 4-14

ii Copyright © 2001–2004 ESRI


Contents

Controlling If Then 4-15


Decision making: The Select Case statement 4-17
Levels of variable scope 4-19
Procedure-level variables 4-21
Module-level variables 4-22
Public-level variables 4-23
Static variables 4-24
Exercise 4 overview 4-25
Exercise 4A: Work with variable scope
Exercise 4B: Create a guessing game

5 Programming with class


Lesson overview 5-2
Class 5-3
Classes and objects 5-4
Class libraries 5-5
ArcObjects Class Libraries 5-6
Exploring class libraries with the Object Browser 5-7
Object Browser icons 5-9
Creating objects at design time 5-10
Instantiating an object in code 5-11
To Set or not to Set? 5-13
Coding a class with Visual Basic 5-14
Client and server environment 5-15
Distributing your classes 5-16
Demonstration: Creating a simple class 5-17
Exercise 5 overview 5-18
Exercise 5: Work with your own object

6 COM before the storm


Lesson overview 6-2
Introducing COM 6-3
COM classes have interfaces 6-4
Working with ArcObjects COM classes 6-5
More on interfaces … 6-6
Polymorphism 6-7
ArcObjects polymorphism 6-8
Using methods and properties 6-9

Copyright © 2001–2004 ESRI iii


Introduction to Programming ArcObjects with VBA Contents

Getting other interfaces 6-10


Testing an object reference 6-12
COM class code 6-14
Using library names 6-16
Using the ESRI Object Browser 6-17
Demonstration: Creating a COM class 6-18
Exercise 6 overview 6-19
Exercise 6: Work with COM classes

7 Understanding object model diagrams


Lesson overview 7-2
ArcObject object model diagrams 7-3
Relationship symbols 7-4
ArcMap objects 7-5
Creatable Class (CoClass) 7-6
Instantiable Class (Class) 7-7
Abstract class 7-8
Inheritance 7-9
Property and method symbols 7-10
Getting properties 7-11
Setting properties 7-12
Finding interfaces 7-13
Wormholes 7-14
Exercise 7A overview 7-15
Exercise 7A: Navigating the object model diagrams
Lesson overview 7-16
Finding object model diagrams 7-17
Finding the right OMD: Step 1 7-18
Finding the right OMD: Step 2 7-19
Finding the right OMD: Step 3 7-20
Finding the right OMD: Step 4 7-21
Where to begin? Getting into the OMD 7-22
Example: MxDocument > Map > layer 7-23
Exercise 7B overview 7-24
Exercise 7B: Using the object model diagrams

iv Copyright © 2001–2004 ESRI


Contents

8 Maps and layers


Lesson overview 8-2
Loop review 8-3
Object model overview 8-4
Accessing maps 8-5
Looping through a collection of maps 8-6
Managing flow in a loop 8-7
Accessing layers 8-8
Working with a map’s layers 8-9
Looping through layers 8-10
Working with layer properties 8-11
Adding a new layer to a map 8-12
Setting a FeatureLayer’s data source 8-13
Exercise 8 overview 8-14
Exercise 8: Working with maps and layers

9 Data access and creation


Lesson overview 9-2
Data creation objects 9-3
Opening an existing Workspace 9-5
Connecting to an ArcSDE database 9-7
Getting a FeatureDataset 9-8
Getting FeatureClasses 9-9
Pseudocode: Adding a data layer 9-10
GxDialog 9-11
Example: GxDialog 9-12
Exercise 9A overview 9-13
Exercise 9A: Create a layer from a shapefile
Working with Name objects 9-14
Creating a new Workspace 9-15
Creating a new Table or FeatureClass 9-17
Field and Fields classes 9-18
IField and IFieldEdit 9-19
Creating a Fields collection 9-20
Creating a Table or FeatureClass 9-21
Work with fields in a table 9-23
Adding rows and values to a table 9-24
Exercise 9B overview 9-26
Exercise 9B: Creating data

Copyright © 2001–2004 ESRI v


Introduction to Programming ArcObjects with VBA Contents

10 Geometry and geoprocessing


Lesson overview 10-2
Geometry objects 10-3
Feature geometry 10-4
Points and multipoints 10-5
Segments 10-6
Polylines and polygons 10-7
Envelopes 10-8
Zooming in to a Feature 10-9
Displaying features 10-10
Geometry spatial operator interfaces 10-11
ITopologicalOperator 10-12
IRelationalOperator 10-13
IProximityOperator 10-14
Area and length 10-15
Spatial reference 10-16
Spatial reference OMD 10-17
Exercise 10 overview 10-18
Exercise 10: Use coordinate input to draw features

11 Working with subsets and selections


Lesson overview 11-2
Object Model overview 11-3
SelectionSet 11-4
Cursors and FeatureCursors 11-6
Creating a QueryFilter 11-7
Returning a Search cursor 11-8
SpatialFilter 11-10
Three types of cursors 11-12
Accessing records in a cursor 11-14
Example: Summarizing a cursor’s attributes 11-15
Review: Features and geometry 11-16
Displaying a subset of features 11-18
Exercise 11 overview 11-19
Exercise 11: Working with subsets and selections

vi Copyright © 2001–2004 ESRI


Contents

12 Symbolizing elements and layers


Lesson overview 12-2
Subclasses of Symbol 12-3
Using color 12-4
ColorRamps 12-5
Creating simple graphic elements 12-6
Example: Make a new element, set its symbol 12-7
Defining an element’s position 12-8
Adding an element to the map (or layout) 12-9
FeatureRenderers 12-11
SimpleRenderer 12-12
UniqueValueRenderer 12-13
ClassBreaksRenderer 12-14
ScaleDependentRenderer 12-15
Storing layers on disk 12-16
GxLayer object 12-17
Example: Saving a layer from ArcMap 12-18
Exercise 12 overview 12-19
Exercise 12: Symbolizing elements and layers

13 Working with layout elements (Optional)


Lesson overview 13-2
Object Model overview 13-3
Review: Elements 13-4
FrameElements 13-5
Example: Reference MapFrames on the layout 13-6
Review: Subclasses of Symbol 13-7
Review: Color classes 13-8
The StyleGallery 13-9
Getting style items from the gallery 13-10
Example: Referencing an individual style item 13-11
Getting the item 13-12
Basic steps: Adding a map surround 13-13
StyleSelector 13-14
Printing a layout 13-15
Exporting a layout 13-16
Exercise 13 overview 13-17
Exercise 13: Working with layout elements

Copyright © 2001–2004 ESRI vii


Introduction to Programming ArcObjects with VBA Contents

14 Using tools
Lesson overview 14-2
Tool events 14-3
Getting the user X and Y 14-4
Display transformation 14-5
Convert display coordinates to map units 14-6
Example: Rubberbanding 14-7
IGraphicsContainer 14-8
Managing graphics 14-9
Refreshing the display 14-10
Partially refresh the display 14-11
Exercise 14 overview: Choose one 14-12
Exercise 14A: Create a tool to draw point graphics
Exercise 14B: Create a Parcel Proximity tool

15 Data management
Lesson overview 15-2
Name objects 15-3
Object Model overview: Name classes 15-4
Creating a DatasetName 15-5
Data manipulation objects 15-6
Converting feature classes 15-7
Exercise 15A overview 15-8
Exercise 15A: Data conversion
Editing with a cursor 15-9
Editing cursors 15-10
Example: Updating misspelled attributes 15-12
Adding a field 15-13
Creating a domain 15-14
Adding a domain to a database 15-15
Assigning a domain to a field 15-16
Exercise 15B overview 15-17
Exercise 15B: Data management

16 Application framework and events


Lesson overview 16-2
Customizing the user interface 16-3
CommandBars class 16-4

viii Copyright © 2001–2004 ESRI


Contents

Types of CommandBar objects 16-5


Components of CommandBar: CommandItems 16-6
Finding a CommandItem 16-7
Finding an ArcGIS toolbar or menu 16-8
Document events 16-9
Example: Displaying a different context menu 16-10
Displaying a new shortcut menu 16-11
Creating new menus 16-12
Creating commands to execute macros 16-13
Updating the ArcID module 16-14
Lesson overview 16-15
Inbound and outbound interfaces 16-16
Finding outbound interfaces 16-17
Using an outbound interface 16-18
Events supported by Map 16-19
Capturing object events 16-20
Coding object events 16-21
Exercise 16 overview 16-22
Exercise 16A: Program the user interface
Exercise 16B: Coding ArcObjects events

17 ArcObjects beyond VBA


Lesson overview 17-2
Visual Basic versus VBA 17-3
Remember COM? 17-4
Basic steps: Building a COM component 17-5
1) Create a new COM project 17-6
2) Create a COM class 17-7
3) Reference the appropriate libraries 17-8
4) Implement the required interface(s) 17-9
Referencing the Application 17-11
Example: Branching in a COM component 17-12
5) Compile your component DLL 17-13
6) Registering your COM component 17-14
Where can COM components plug in? 17-15
Resources for creating custom components 17-17
Exercise 17 (Optional): Building a COM command 17-18
Lesson overview 17-19
ArcGIS Engine 17-20

Copyright © 2001–2004 ESRI ix


Introduction to Programming ArcObjects with VBA Contents

ArcGIS Engine Developer Kit 17-21


Engine Runtime 17-22
Why ArcGIS Engine Developer Kit? 17-23
ArcGIS Engine Developer Kit resources 17-24
Lesson overview 17-25
ArcGIS Server 17-26
Why ArcGIS Server? 17-27
ArcGIS Server resources 17-28
Exercise 17: Creating COM classes with Visual Basic (Optional)

x Copyright © 2001–2004 ESRI


Course name goes here

Introduction to
ModuleTitle

Programming
ArcObjects with VBA Welcome 1-2
Logistics
Course materials
Course objectives
contents
1-3
1-4
1-5
Course timeline 1-6
What is ArcGIS? 1-7
Software support resources 1-8
Learning paths 1-9
VBA: Visual Basic for Applications 1-11
What can ArcObjects do? 1-12
Exercise options 1-16
Exercise typographic conventions 1-17
Exercise 1 overview 1-19
Introduction to
Programming ArcObjects
with VBA

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA

Introduction to Programming ArcObjects with VBA Introduction 1-1


Welcome to Intro to Programming ArcObjects
‹ Instructor introduction
‹ Student introductions
‹ Name

‹ Organization

‹ Role in organization
‹ Programming experience
‹ GIS experience
‹ Goals and expectations
for this class

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-2

Welcome to Introduction to Programming ArcObjects with VBA.

Prerequisites: Introductions to Visual Basic for ESRI software (Virtual Campus


course)
Introduction to Programming ArcObjects with VBA is a five day course, consisting of
approximately 40 hours of class time. The course uses instructor-led lectures and
demonstrations in conjunction with hands-on programming exercises. You should expect to
spend most of your class time engaged in writing Visual Basic code for the ArcMap and
ArcCatalog applications.

Introduction to Programming ArcObjects with VBA Introduction 1-2


Logistics
‹ Daily schedule
‹ Start _______________
‹ Lunch _______________
‹ Finish _______________
‹ Facilities
‹ Refreshments and break area
‹ Restrooms

‹ Telephones and messages


‹ Internet access
‹ Student ID badges
‹ Parking

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-3

Daily schedule
Under normal conditions, the class will begin each day at 8:30 a.m. and continue until 5:00
p.m. There will be at least one break in the morning and one in the afternoon. You will
generally be given one hour for lunch.

Facilities
Your instructor will provide information regarding the facilities.

Internet access
Some training facilities provide Internet access for your use during class. ESRI® regards
Internet access as an essential business resource for classroom demos, exercises, arranging
travel, and maintaining contact with your office. Please limit your use of the Internet to
business activities only and, as a courtesy to your classmates, refrain from typing or surfing
during lecture presentations.

Introduction to Programming ArcObjects with VBA Introduction 1-3


Course materials
‹ Books
‹ Lecture
‹ Exercise
‹ CDs ESRI
Training Data

‹ Course data
‹ Samples
‹ Online course evaluation
http://classeval.esri.com
‹ Requires Course Identification Number
‹ Software evaluation
‹ E-mail enhancement requests to product teams
Š [email protected]

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-4

Teaching methods
Research indicates that students learn differently. This course maximizes your learning
experience by combining instructor-led lectures and discussions, demonstrations, computer-
based exercises, and review questions.

Class materials
Your class materials include lecture and exercise course books, and Object Model Diagrams.
These are yours to take home, so feel free to write in them.
Included at the back of your exercise book is a CD that contains all the data required for the
course. Here you will find all the map documents, data, and solution code used for each
exercise. You will also find over 100 different code samples that are not described or used
during the course, but that you might find useful when you begin to write your own
applications.
The class data CD contains all the data sets you will work with during class. A second CD
contains the ArcSDE 8.1 for SQL Server software, which you will install later today.

Course evaluation
Your feedback improves ESRI’s courses. At the end of the week, please evaluate the
following:
• Instructor • Course materials • Teaching facilities • Overall course

Software evaluation
If you have access to a Web-based e-mail account during class, you can send comments about
the software directly to the product development teams. Your comments directly influence
enhancements to ESRI products, so please let us know what you think.

Introduction to Programming ArcObjects with VBA Introduction 1-4


Course objectives
‹ Reinforce VBA programming techniques
‹ Build VBA Applications with ArcObjects
‹ Understand Object Oriented Programming
‹ Gain familiarity with COM classes
‹ Interpret ArcObject Object Model Diagrams
‹ Gain comfort in programming with some of the commonly used
ArcObjects

‹ Ask questions and participate in discussions

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-5

Introduction to Programming ArcObjects with VBA is a five day course that focuses on the
concepts of the component object model (COM), object oriented programming, and
understanding the ArcObject object model. Although no prior experience with Visual Basic
(VB) is assumed, the introductory portion of the course moves very quickly. Fundamental VB
topics are covered in the first couple of lessons, and then applied (and thus reinforced)
throughout the week.
You will learn to program through a combination of instructor-led lectures and hands-on
programming exercises. You should expect to spend the majority (approximately 60%) of
your class time writing Visual Basic code. Later in the week, your instructor will give you
time to experiment on your own, either by choosing a programming task from a set of
workshop exercises in Appendix B, or by tackling your own programming problem.
By the end of the course, you can expect to have a solid understanding of the VBA
development environment. You will be able to modify the user interface, design VB user
forms, and write applications that enhance or extend the functionality of ArcGIS.

Introduction to Programming ArcObjects with VBA Introduction 1-5


Course timeline
‹ VBA Skills
Day 1
‹ Working with Classes

‹ COM Classes
Day 2
‹ Reading OMDs

‹ Maps and Layers


Day 3
‹ Selections and Subsets

‹ Symbolizing layers
Day 4
‹ Data management

‹Application framework
Day 5
‹ArcObjects beyond VBA

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-6

Day 1 Day 2 Day 3 Day 4 Day 5


Lesson 1: Lesson 6: Lesson 9A: Lesson 12: Lesson 15B:
Introduction Working with Data access Layer Data
Lesson 2: COM and creation Rendering Management
The VBA
Environment

Break Break Break Break Break


Lesson 3: Lesson 7A: Lesson 9B: Lesson 13: Lesson 16A:
Visual Basic Understanding Data access Working with Application
code: How, Object Model and creation Layout Framework
where, when? Diagrams Elements

LUNCH LUNCH LUNCH LUNCH LUNCH


Lesson 4: Lesson 7B: Lesson 10: Lesson 14: Lesson 16B:
Using Understanding Working With Using Tools Events
Variables Object Model Geometry
Diagrams

Break Break Break Break Break


Lesson 5: Lesson 8: Lesson 11: Lesson 15A: Lesson 17:
Programming Maps & Subsets and Data ArcObjects
with Class Layers Selections Management beyond VBA

Introduction to Programming ArcObjects with VBA Introduction 1-6


What is ArcGIS?
E
E ArcGIS Desktop ArcGIS Engine X
T
X E
T ArcInfo
Custom
Custom N
ArcInfo application
S
E application I
ArcGIS clients N O
N
S ArcEditor
ArcEditor S

I
O
ArcView
ArcView Web
Web
ArcReader
ArcReader N ArcPad
ArcPad browser
browser
S

Components ArcObjects
ArcObjects

Network

ArcGIS
ArcGIS Server
Server ArcIMS
ArcIMS

Application/Data ArcSDE
ArcSDE
servers
RDBMS

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-7

ArcGIS is the name used to identify ESRI’s flagship family of GIS products. ArcGIS®
includes ArcGIS client software, components, and application and data server software.
ArcGIS itself is not a GIS application; rather, it is a set of software products for building
ArcGIS systems that best suit your GIS needs.
ArcGIS is based on a common library of shared GIS software components, called
ArcObjects™.
ArcGIS is composed of client and server applications. Each software application can create,
manage, analyze, and serve data stored in one or more formats.
•ArcGIS Desktop: Integrated suite of advanced GIS applications consisting of three software
products: ArcView®, ArcEditor™, and ArcInfo®. The ArcGIS Desktop applications provide the
same core mapping, editing, and analysis functionality. The level of functionality available
differs depending on which license you have. ArcInfo provides users with the most complete
level of GIS functionality. It is composed of ArcInfo Desktop and ArcInfo Workstation.
•ArcReader™: Allows users to view high-quality published maps (PMFs) created in ArcMap™.
•ArcGIS Engine: Developer toolkit of embeddable GIS components for building custom
stand-alone applications using COM, C++, Java, and .NET.
•ArcPad®: Used with PDAs for creating and managing data while in the field.
•ArcGIS Server: A shared library of GIS software objects used to build and develop server-
side GIS applications in enterprise and Web computing frameworks.
•ArcIMS®: Used to publish maps, data, and metadata through open Internet protocols.
•ArcSDE®: Manages and serves spatial information from external RDBMs to ArcGIS clients.
For more information, go to http://www.esri.com/software/index.html.

Introduction to Programming ArcObjects with VBA Introduction 1-7


Software support resources
‹ ESRI Support Center
a gateway to resources
http://support.esri.com
‹ Knowledge Base
‹ Technical articles
‹ White papers
‹ System requirements
‹ Downloads
‹ Patches and service packs
‹ Data models
‹ ArcScripts ‹ For Developers
‹ User Forums ‹ Developer resources
‹ Discussion groups ‹ Request ESRI Technical Support
‹ E-mail lists ‹ Available to support subscribers
Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-8

ESRI’s primary resource for software support is the ESRI Support Center at
http://support.esri.com.

Knowledge Base
The Knowledge Base is a searchable database of focused technical articles. It includes
answers to frequently asked questions, step-by-step directions for performing common tasks,
and workarounds for known software limitations. The Knowledge Base also contains topic-
focused white papers organized by product, system requirement information, and product
documentation.

Downloads
Obtain the latest software correction, software and code samples, utilities, tutorials, user
contributed scripts and sample code (ArcScripts), data models, and evaluation software from
ESRI’s Download page.

User Forums
In the user forums, you can ask questions, provide answers, and exchange ideas with other
ESRI product users. Resources include several discussion forums, and two subscription e-mail
discussion lists moderated by ESRI. ArcView-L is for ArcView users, and ESRI-L is for users
of all other ESRI products.

For Developers
This page is for ESRI’s developer community. It provides the latest developer information,
including sample code, technical documents, and object model diagrams for ESRI’s developer
products.

Introduction to Programming ArcObjects with VBA Introduction 1-8


Learning paths
http://www.esri.com/training_events.html

‹ Learning Guide
‹ Learning paths organized
by software and topic

‹ Learning options
‹ Instructor-led courses
‹ Virtual Campus courses
‹ Training seminars
‹ Web workshops

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-9

Depending on which ESRI software your organization has licensed, your skills, and your
plans for upcoming projects, you may benefit from additional training on advanced topics, on
specialized software, or on background topics to refine your understanding of GIS and related
technologies.
Detailed information about Instructor-led and Web-based courses—including a list of topics
covered, intended audience, duration, schedules, and pricing—is available in the ESRI Course
Catalog. You can access this catalog on the Web at http://www.esri.com/training/index.html.
On the ESRI Training Web site, you can also find information about new courses developed
since the course catalog was printed.
Web-based courses offer convenience and savings. Also, many ESRI Virtual Campus courses
include a free lesson, called a module. You can create a free account and begin training with
these free modules within minutes at http://campus.esri.com.
In addition to Web-based courses, the Virtual Campus also offers free live training seminars,
training seminars, and Web workshops. Live training seminars are focused lectures on a
variety of GIS topics for all levels of users. Consult the Virtual Campus for upcoming topics,
dates, and times. Training seminars are free recordings of live training seminars, viewable at
your convenience. Workshops are recordings of live training seminars, viewable at your
convenience, plus printable slides of the presentation, questions and answers from the live
training seminar, a software exercise with accompanying data, an optional exam to assess
understanding, and a certificate for successfully completing the exam.

Introduction to Programming ArcObjects with VBA Introduction 1-9


Learning paths
Foundation Extensions
ArcSDE
Introduction to Learning
i W Databases
ArcGIS I ArcGIS I
Many Others

Customization / Advanced Customization /


Programming Programming

Introduction to Introduction to
Extending the
Visual Basic Programming
W i ArcGIS
for ESRI ArcObjects i
Desktop
software with VBA
Applications

Other ArcObjects/VBA Resources


Developing Developing
Virtual
Getting to Applications Applications
Campus VBA i i
W B Know with ArcGIS with ArcGIS
Workshop
ArcObjects Engine Server
Series

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-10

Courses identified with the i symbol occur in a classroom with an instructor. The W
symbol indicates Web-based courses available on the ESRI Virtual Campus at
http://campus.esri.com. The B indicates a book from ESRI press available at
http://gis.esri.com/esripress/display/index.cfm.
Students taking this course (Introduction to Programming ArcObjects with VBA) are expected
to have a least a basic understanding of programming languages. The Web based course
Visual Basic for ESRI Software will provide sufficient information for taking this course.
ESRI’s Virtual Campus also has a 4 part VBA Workshop Series that introduces you to to the
VBA environment, also a sufficient prerequisite for this course. You may also find the ESRI
press book, Getting to Know ArcObjects to be an excellent resource to get start with
ArcObjects and a valuable resource even as you become more proficient with using
ArcObjects.
After completing Introduction to Programming ArcObjects with VBA, you may want to further
your knowledge by taking advanced ArcObjects courses. This course is a prerequisite to the
advanced ArcObjects courses that ESRI provides. The subject matter of these advanced
courses will be discussed on the following slides and the last section in this course..

Introduction to Programming ArcObjects with VBA Introduction 1-10


VBA: Visual Basic for Applications

‹ Evolution of software customization languages


‹ VBA: Single programming language and development
environment embedded within an application
Past Future Now
Applications had separate Applications can share one
customization languages customization environment

Application Programming Application Programming


Language Language

Access Access Basic Access


ArcView® Avenue™ ArcView
Word Word Basic VBA
Word
ArcInfo AML ArcInfo

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-11

Visual Basic for Applications


The VBA development environment consists of two primary tools: the Customize dialog box
for interactively modifying the user interface, and the Visual Basic Editor for creating user
forms and for writing, testing, and debugging Visual Basic code. Because VBA is the industry
standard, there are two big advantages to programming in this environment. First, if you are
familiar with using VBA in a particular application, you will find it very similar (sometimes
nearly identical) in other applications that support it. Second, you will be able to (easily) use
object libraries between applications. When developing an application for Power Point, for
example, you might choose to embed objects from the ArcObject library (or vice versa).

Other applications that use the VBA development environment


Microsoft Office: Excel, PowerPoint, Word, and so on.
Visio
Corel WordPerfect Office 2000
Corel Draw 9
AutoCAD
MYOB Accounting (Accounting package for small businesses)
Micrografx iGrafx series (Business graphics)
OmniTrader (Securities tracking and analysis )
Many others …

Introduction to Programming ArcObjects with VBA Introduction 1-11


What can ArcObjects do?
‹ Use VBA to extend ArcMap/ArcCatalog
‹ Create custom
user forms,
buttons and
tools
‹ Automate
workflows
‹ Subject of this
course

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-12

Using VBA to extend ArcMap/ArcCatalog


Both ArcMap and ArcCatalog come with Visual Basic for Applications (VBA). VBA
provides an integrated programming environment and the Visual Basic Editor. VBA is an
excellent way to create custom commands. You can create a new button, tool, combo box, or
edit box (all referred to as UIControls), then attach code to the control’s events. Once you
have your custom control created, you can drag it to any toolbar. Macros can also be created
which can be executed from the Tools toolbar. By creating the UIControls and Macros you
can build sophisticated ArcGIS applications for the user to interact with and automate
workflows. All of these concepts will be covered in this course.

Introduction to Programming ArcObjects with VBA Introduction 1-12


What can ArcObjects do?
‹ Use stand alone programming language to extend
Desktop applications and geodatabase
‹ Create custom components
to enhance functionality Edit
Edit Task
Task
‹ Extending the ArcGIS
Desktop
Applications
Command
Command

Table
Table of
of Contents
Contents Tab
Tab

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-13

Extending ArcGIS Desktop Applications


In some cases, you will want to extend ArcGIS Desktop outside of VBA. You can create
custom objects that plug into ArcGIS Desktop with any programming language that supports
the Microsoft Component Object Model (COM), such as Visual Basic 6.0 or Microsoft Visual
Basic .NET. Custom commands or toolbars created outside VBA are often distributed as
ActiveX DLLs. If you have created custom commands and toolbars, you can distribute these
as ActiveX DLLs and easily add these objects to ArcMap or ArcCatalog. This will put the
code into a binary version of the object so the end user will never see the source code.
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 custom features.
Some of these more advanced customizations cannot be accomplished through the VBA
environment.
The information on this subject matter is discussed in the Extending the ArcGIS Desktop
Applications instructor-led course.

Introduction to Programming ArcObjects with VBA Introduction 1-13


What can ArcObjects do?
‹ Use the ArcGIS Engine Developer Kit to build custom
applications
‹ Developing Applications with ArcGIS Engine
Windows
Example

Java Example

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-14

The ArcGIS Engine Developer Kit


The ArcGIS Engine Developer Kit allows developers to create custom applications that can be
deployed to machines that do not currently have ArcGIS Desktop installed. It provides the
developer with many resources to complete their development task. The ArcGIS Engine
Developer Kit is not a product for end users. It is strictly for people who are developing
applications. As a developer, you can build applications based on ArcGIS Engine and deliver
those programs to end users.
The ArcGIS Engine supports a variety of developer languages including COM, .NET, JAVA,
and C++, which allows applications to be deployed on different platforms.
The information on this subject matter is discussed in the Developing Applications with
ArcGIS Engine instructor-led course.

Introduction to Programming ArcObjects with VBA Introduction 1-14


What can ArcObjects do?
‹ Use ArcGIS Server to build custom Web-based
applications
‹ Developing Applications with ArcGIS Server
Geodatabase Editing

Network Tracing
Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-15

ArcGIS Server
ArcGIS Server allows you to build custom Web-based applications, exposing ArcObjects
through the Internet or LAN (Local Area Network). ArcGIS Server is a GIS enterprise
application server that provides complete GIS capabilities throughout an organization while
maintaining a centrally managed database. Mapping, geocoding, spatial queries, editing,
tracing and linear referencing are all examples of applications that developers can build using
ArcGIS Server. These applications can be consumed by browser-based clients, custom
applications built with ArcGIS Engine, and ArcGIS Desktop. ArcGIS Server will support all
common development environments (Java, .NET, C++, COM) and all major server platforms.
The information on this subject matter is discussed in the Developing Applications with
ArcGIS Server instructor-led course.

Introduction to Programming ArcObjects with VBA Introduction 1-15


Exercise options
‹ Exercise shortcut

‹ Full exercise steps

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-16

Exercise shortcut
Appearing at the beginning of an exercise, the exercise shortcut summarizes the steps found in
the main exercise. Each shortcut step corresponds with the same step number in the main
exercise.
Exercise shortcuts are ideal for those students who have had some experience with the
software and want to be challenged by trying to complete the step without detailed
explanation. Of course, if you cannot complete the shortcut step, you can refer to the main
exercise for more detail.

Full exercise steps


The main exercise steps provide detail on how to complete each task. If you are new to the
software, follow the full exercise steps.

Introduction to Programming ArcObjects with VBA Introduction 1-16


Exercise typographic conventions
Descriptive
Action text

9
9 Control
Note name

Keyboard
input
Warning

Question with hint

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-17

Before you begin your first exercise, you need to recognize the typographic conventions used
in your exercise coursebook.

Descriptive text
This text can provide an overview of the next sequence of actions, a review of actions just
completed, or an interpretation of output on your computer monitor. Descriptive text may
introduce what is about to happen with phrases like “Next, create a new map in ArcMap”; the
actual instruction follows, indicated by the checkbox symbol.

Action
Actions are tasks—like starting an application, clicking a button, or typing a command—that
you must perform during the exercise. The square checkbox symbol indicates an action; act
only on instructions that are prefaced with the checkbox symbol.
You can mark the checkbox symbol in your exercise coursebook as you complete each task.
This is especially helpful when shifting your attention between your book and your computer
monitor.

Control name
Names of objects on your monitor with which you interact are italicized in your exercise
coursebook. These include windows, menus, and buttons. Many buttons reveal their names
when you hold your mouse pointer over them.

Introduction to Programming ArcObjects with VBA Introduction 1-17


Note
Paragraphs prefaced with Note: provide inconsequential information, such as an optional way
to perform an action or platform-specific syntax for a script.

Warning
The large exclamation point symbol and bold text signals critical information for performing
the next action. Warnings may alert you to a subtle syntactical rule in a command you will
type or inform you that the next button you click will produce an error intentionally. If you
have questions about a warning, ask your instructor for clarification before proceeding.

Keyboard input
Text you need to type—like commands in a Command Prompt, entering a file name in a Save
dialog, and pressing Ctrl + Alt + Delete—appears in bold, constantly-spaced font.

Question with hint


Questions require you to record answers in your course book. Questions are renumbered
within each exercise and may be followed by a hint.
Sometimes the answer to one question depends on your answer to a previous one. Courses that
use this teaching technique extensively will include an exercise worksheet as an appendix in
your lecture course book, enabling you to record all answers on the worksheet for easier
cross-referencing.
Answers to questions immediately follow each exercise.

Introduction to Programming ArcObjects with VBA Introduction 1-18


Exercise 1 overview
‹ Install the class data

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-19

Introduction to Programming ArcObjects with VBA Introduction 1-19


Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 1-20

Introduction to Programming ArcObjects with VBA Introduction 1-20


The VBA development
Introduction to Programming ArcObjects with VBA

environment
Lesson overview 2-2 Writing Visual Basic statements 2-20
The VBA development
environment
ArcGIS commands
2-3
2-4
Some common Visual Basic
functions
Procedure types
contents
2-21
2-23
Using the Customize dialog box 2-5 Running an event procedure 2-24
The Customize dialog 2-6 Navigating event procedures in a
Using the Customize dialog box 2-8 module 2-25
Creating a new command 2-9 The ThisDocument module 2-26
Setting control properties 2-10 Creating a new module 2-27
Accessing your customizations 2-11 Creating a new sub or function
Storing your customizations 2-13 procedure (macro) 2-28
Examining a control’s source Defining procedure scope 2-30
code 2-14 Running a subroutine or function
Demonstration 2-15 procedure 2-31
Overview 2-16 Adding a macro to a toolbar 2-32
The Visual Basic Editor 2-17 Getting help 2-33
Understanding ArcMap Exercise 2 overview 2-34
software’s code storage 2-19
The VBA development
environment

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA

Introduction to Programming ArcObjects with VBA The VBA development environment 2-1
Lesson overview
‹ The VBA development environment
‹ Customize dialog box
‹ Create new toolbars and commands
‹ Add, delete, and move commands
‹ Set control properties
‹ Storing and distributing customizations
‹ Visual Basic Editor
‹ Code storage
‹ Modules

‹ Procedures

‹ Visual Basic statements

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 2-2

Lecture 2 overview
In this lesson, you will learn about the VBA development environment. This environment
consists of the Customize dialog box, which is used to modify the ArcMap or ArcCatalog
graphical user interface, and the Visual Basic Editor, which is used to write VBA procedures
(macros).
The first half of this lesson will discuss the Customize dialog box. You will learn how to
modify the ArcMap and ArcCatalog user interface by (1) adding new toolbars, (2) adding
existing ArcGIS commands, (3) removing existing commands from toolbars and menus, (4)
altering command properties (e.g., icon), and (5) creating custom interface controls. You will
also learn how to store and distribute your customizations.
The last half of this lesson will teach you how to use the Visual Basic Editor.

Introduction to Programming ArcObjects with VBA The VBA development environment 2-2
The VBA development environment
‹ Similar environment for all applications that use VBA
‹ Customize dialog box: Interface customization
‹ Visual Basic Editor: Writing code

Customize
dialog box

Visual Basic Editor

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 2-3

The VBA development environment consists of two parts: the Customize dialog box for
modifying the user interface and the Visual Basic Editor for writing code.
An advantage of using VBA that you will soon discover is that several applications use the
VBA development environment for customization. While these environments are not identical,
they are very similar. All Microsoft Office products, for example, will have a Customize
dialog box that allows you to add, remove, and rearrange interface controls. All of these
applications will have a Visual Basic Editor for writing macros or designing forms. Once you
are familiar with the ArcGIS™ VBA development environment, your skills will be portable to
several other applications.

Customize dialog box


The Customize dialog box is a powerful tool that allows you to customize ArcMap and
ArcCatalog without writing a single line of code. You can create, add, move, and
remove toolbars and commands, and even add tools others have created.

Visual Basic Editor


The Visual Basic Editor provides an interface for creating forms and writing code. It
also provides several utilities for debugging and getting help that will be discussed
throughout this course.

Introduction to Programming ArcObjects with VBA The VBA development environment 2-3
ArcGIS commands
‹ Toolbars and menus contain commands
‹ Commands are buttons, menus, macros, and UIControls
‹ Each command has associated code

Toolbar
Toolbar

Commands
Commands

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 2-4

ArcMap and ArcCatalog have toolbars that contain commands (i.e., controls). Commands are
things such as buttons and menus, macros (Visual Basic procedures), and UIControls (user
interface controls). UIControls are custom controls that an ArcGIS VBA developer can add to
the interface to perform specialized tasks. There are four types of UIControls:
UIButtonControls, UIToolControls, UIEditBoxControls, and UIComboBoxControls. COM
commands are similar to UIControls, except they are stored in DLL, EXE (executable), or
similar files and are created by a developer in a full-scale programming environment such as
Visual Basic or C++.
Users interact with commands by clicking, typing, selecting, or applying, depending on the
type of control. Behind each control, there is associated code that will execute in response to
user interaction. As a developer of a UIControl, you can write code to respond to button clicks,
mouse interaction (mouse button down, mouse button up, mouse move), and keyboard typing.
While the Customize dialog box is open, you can reorganize commands by dragging and
dropping them to a new location on a toolbar or menu. You can even drag them between
toolbars and menus or remove them altogether.

Introduction to Programming ArcObjects with VBA The VBA development environment 2-4
Using the Customize dialog box
‹ Open the dialog to put the interface in design mode
‹ With the Customize dialog box open, you can …
‹ Rearrange or remove existing commands
‹ Add new toolbars and commands
‹ Change command properties

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 2-5

In the ArcMap and ArcCatalog Customize dialog box, you will find utilities for adding new
toolbars, menus, and commands to the user interface. You may want to simply modify some of
the existing commands by rearranging them or changing their icon, for example. Regardless of
the interface customization you want to make, however, you always need to start by opening
the Customize dialog box.
While the Customize dialog box is open, the user interface is in design mode, which means
clicking on commands will not execute them but will instead allow you to rearrange them or
change their properties. Once you are satisfied with the interface customizations you have
made, close the Customize dialog box to begin working with the controls.

Introduction to Programming ArcObjects with VBA The VBA development environment 2-5
The Customize dialog
‹ Three tabs (panels)
‹ Toolbars: Turn toolbars on or off, create new toolbars
‹ Commands: Drag new commands onto the interface
‹ Options: Lock customization with a password, etc.

A
Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 2-6

The Customize dialog has three panels: Toolbars, Commands, and Options. The Toolbars and
Commands tabs are the ones you will use to modify the user interface, while the Options tab
provides some control over basic customization options.

Toolbars
On the Toolbars tab of the Customize dialog, you have the ability to work with existing
toolbars by turning them on or off, renaming them, or deleting them. If you make a mistake
while customizing the interface, you can also reset an individual toolbar to its original state by
selecting it in the Customize dialog and clicking Reset.
You may also use the Customize dialog to create brand new toolbars. When creating a new
toolbar, you will be prompted for a name and a location in which to save it (more about storing
customizations later). A new toolbar will be nothing more than a small gray box; to add
commands to a new toolbar, use the Commands tab.

Commands
The Commands tab on the Customize dialog box contains all existing ArcMap or ArcCatalog
commands (depending on which application you are customizing). Commands can be dragged
from the Customize dialog onto a toolbar as a button or onto a menu as a menu choice.

Introduction to Programming ArcObjects with VBA The VBA development environment 2-6
Options
The Options tab on the Customize dialog box allows you to control some basic properties of
your customization development environment.
Lock Customization: Clicking this will allow you to provide a password to protect your
customizations. When a user tries to access the Customize dialog box or the Visual Basic
Editor, he or she will be required to provide the password.
Change VBA Security: Viruses may be distributed in a macro within a document, template, or
add-in. When you open such a document or perform an action that triggers a macro virus, the
macro virus might be activated, transmitted to your computer, and stored in your Normal
template. The levels of security are described in the Security dialog box to reduce the chances
of macro viruses infecting your documents, templates, or add-ins.
Update ArcID module: All commands in ArcGIS have a unique identifier (UID) that allows a
programmer to easily reference it in code. This ID is stored in a special document called the
ArcID module. Update this module to write unique identifiers for custom interface commands
(DLLs you have added from file) to the ArcID module.

Introduction to Programming ArcObjects with VBA The VBA development environment 2-7
Using the Customize dialog box
‹ Commands are organized into categories
‹ All ArcMap or ArcCatalog commands are here
‹ Some that are not on the interface by default

‹ Drag commands onto toolbars or menus

Command Categories

Commands

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 2-8

As mentioned earlier, the Customize dialog box contains all ArcMap or ArcCatalog
commands. These commands are available on the Commands tab and are organized into
categories. By highlighting a category on the left side of the dialog, you will see all commands
in the category listed on the right. Some familiar categories are things like Selection,
Pan/Zoom, and File. You will also find categories for Visual Basic procedures you write
yourself (Macros), for creating new menus (New Menu), and for creating new custom controls
(UIControls). Because many of the commands you find here are not found on the default (out-
of-the-box) ArcGIS interface, you might find a few gems here: functionality that you did not
know existed.
Once you locate a command you want to add to the interface, you can select the command in
the dialog and drag it to a toolbar as a button or onto a menu as a menu choice. You need to be
careful, however, as controls that require user interaction will not work as menu choices, and
some commands only work as context menu choices (e.g., layer properties).

Introduction to Programming ArcObjects with VBA The VBA development environment 2-8
Creating a new command
‹ UIControls category
‹ User-created commands

‹ Four types
‹ Button

‹ Tool

‹ EditBox

‹ ComboBox

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 2-9

Creating new commands (user interface controls)


The Customize dialog box contains controls you develop yourself in a category called
UIControls. You can add these commands to the user interface by dragging them onto a
toolbar or menu, just as you would any ArcGIS command. To create a new UIControl, click
New UIControl and choose one of the four types described below.
• UIButtonControl: a simple button or menu choice.
• UIToolControl: use to create a tool. Differs from a button in that the developer has access
to mouse and keyboard input while the tool is selected.
• UIEditBoxControl: a text line (on a toolbar or menu) that allows the user to type some
input.
• UIComboBoxControl: a pulldown list that allows the user to choose existing items (text)
or to type his or her own.
Once you have created one of these controls, the next step would be to write the Visual Basic
code behind the control user events (button clicks, mouse, keyboard, etc.) that make it work.

Adding custom commands from file


Custom commands are ActiveX controls or libraries stored as OLB, TLB, EXE, OCX, and
DLL files. You can add these custom commands from the Customize dialog box by clicking
Add From File. Once you add a custom control from file, it will be placed in the appropriate
category in the Customize dialog box (sometimes a new category is created). Just like the other
controls in the dialog, you must then drag the command to the desired location on the interface.
Note: These controls would have been developed in a standalone programming environment
such as Visual Basic or C++, and cannot be created in VBA.

Introduction to Programming ArcObjects with VBA The VBA development environment 2-9
Setting control properties
‹ Customize dialog box must be open
‹ Right-click a control to view and change properties
‹ Characteristics that define appearance
‹ Name

‹ Image

‹ Display text or image


‹ Begin a group

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 2-10

Command properties
While the Customize dialog is open, the user interface is in design mode. To access command
properties, simply right-click on a command and use the context (popup) menu that appears.
With the dialog open, you can modify the following command properties.

Name
The text that appears for a command if Text Only or Image and Text is chosen for
display. Changing the Name property does not affect how the command is referred to in
code.

Button image
You can choose a new icon for any command (including menu choices) by selecting
one from the menu or browsing to one of your own. If you create your own image, it
must be a bitmap (.bmp) that is 16 x 16 pixels.

Text and image


There are three ways in which a command can be displayed on a toolbar: Text only (see
the Name property described above), Image only, or both Image and Text. Menu
commands (choices) may be displayed as Text or Image and Text; you may not use the
Image only choice for menu choices.

Groups
Beginning a group adds a separator line to the left of the selected control. Use groups to
visually organize related commands.

Introduction to Programming ArcObjects with VBA The VBA development environment 2-10
Accessing your customizations
‹ ArcMap has three levels of storage
‹ Templates are read in order on startup

Affects all documents Normal Template

Affects all documents


Base Template
using this template

Affects this document This Document

‹ ArcCatalog only uses the Normal template

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 2-11

Templates
In ArcMap, there are three levels at which you can store your customizations: the Normal
template (Normal.mxt), an intermediate (or base) template (*.mxt), and the current map
document (*.mxd). Each level of customization is represented by a document. Upon opening a
map, these documents are read from top to bottom in the graphic above in order to incorporate
customizations from all levels.
The read order is important because changes in one template can affect other templates and the
current map. For example, the Normal template may have the AddData command turned off,
but a base template may turn on the AddData command.

Normal template
The Normal templates contain all the original ArcMap (Normal.mxt) and ArcCatalog
(Normal.gxt) graphical user interface (GUI) settings. Every time an application starts, the
Normal template is read. The Normal templates are stored in the user’s Windows NT Profiles
directory for Windows NT or in the user’s Documents and Settings directory for Windows
2000 and XP. Each user can have different customizations stored in the Normal templates even
if they are running the same installation of ArcGIS.
In ArcCatalog, all customizations are stored in the Normal.gxt template. If the Normal
template is deleted, it is re-created when the application starts.

Base template
Base templates allow you to store map elements for the creation of standard maps. When
initially creating a new ArcMap map document, you can choose to base your map on a
template. While there are several predefined base templates that come with ArcGIS, you can
actually save any map document as a template (*.mxt). Templates can also store
customizations, which will apply to all maps subsequently produced from them.

Introduction to Programming ArcObjects with VBA The VBA development environment 2-11
Map document
The most local level of customization is the map document itself (*.mxd). Customizations
stored in the map are available only in that particular document. The map document is the last
document to be read when opening a map, so customizations at this level can override ones
defined in the Normal or Base templates.

Introduction to Programming ArcObjects with VBA The VBA development environment 2-12
Storing your customizations
‹ All customizations are saved
‹ Normal template, Base template, or the current document

‹ Current map overrides any templates


‹ For example, controls can be added or removed

Save in: Normal.mxt

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 2-13

All ArcMap customizations are stored at one of the three levels described on the last slide.
Everything from new Visual Basic forms and programs to simply changing a command’s
image is saved in Normal.mxt, a base template (*.mxt), or with the current map document
(*.mxd). When a map is opened, these three documents are read in the following order.

Normal template
The Normal template is always read first when opening a map. Because the Normal template is
stored in the Windows user profiles directory, customizations stored here are global to a
specific login. If the Normal template does not exist when ArcMap or ArcCatalog is started, an
out-of-the-box version is re-created. As a precaution, you should make periodic backups of the
Normal template if you are storing a lot of customizations there.

Base template
Base templates are designed primarily to store a set of map layout elements, such as north
arrows, scale bars, and base layers, to aid in the production of standard maps. These templates
may also contain customizations such as specialized controls or scripts. As an example, your
organization might work with parcel maps that all have a custom property value calculator
control inherited from their common template. Maps that were not produced from this template
would not have the custom control.

Current map
If customizations are saved in a map document, they will only be available in that particular
document. For example, you might have a map document that contains sensitive information
such as archaeological site locations. You could protect this particular document with a custom
startup routine that prompts for a password when the map document is opened.

Introduction to Programming ArcObjects with VBA The VBA development environment 2-13
Examining a control’s source code
‹ Commands have events (e.g., Click, Double-click,
MouseUp, KeyDown, KeyUp)
‹ Code runs when its corresponding event occurs

Copyright © 2001–2004 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA 2-14

Control source code


The code behind a command is called the source code or sometimes simply the source. By
right-clicking on a custom control (UIControl or Macro) and choosing View Source, you can
view (and edit) its source code. Because the existing ArcGIS commands have been compiled
as DLLs (and were written in C++ anyway), you cannot view or edit an existing command’s
source code.

Code window
When you first create a UIControl, it only knows how to be a control but has no real code to
make it work. It other words, if it is a button it will click like any other button, if it is an edit
box it will allow you to type text in it, and so on. It will have all the properties of a control
(such as an image and a name) but will not do anything when it’s interacted with. To add
functionality to a control, you can choose View Source as shown above to access the control’s
associated code document (module). Once you are in the control’s code module, you can write
Visual Basic programs that are associated with user events (e.g., a button click).

Introduction to Programming ArcObjects with VBA The VBA development environment 2-14
Exploring the Variety of Random
Documents with Different Content
CHAPTER XVII

SOFIA, SALONIKA, AND SO TO BED

Stimulated by the knowledge that Varna was occupied by the British


we walked the decks openly, flaunting our protean rôles of British
officers, highly contented men, first-class passengers, and third-class
scarecrows.

Like the Batoum, the Red Cross ship brought others who began the
voyage as semi-stowaways. Commodore Wolkenau had told us in
Odessa that among our shipmates would be a certain General from
Denikin's army. We found him—a tall, bearded, Grand-Duke-
Nicholas-like man—dining in the second-class saloon, and wearing a
suit of clothes nearly as shabby as our own. To dodge investigation
by the Austrian port authorities he had assumed, with the
connivance of the ship's captain, the character of an engineer's
mate. The "engineer" who owned him as mate was in reality a
commander of the Russian Imperial Navy, also attached to Denikin's
forces. The pair of them were travelling to Salonika, as emissaries of
General Denikin, to ask the Franco-British command for arms,
ammunition, and financial support.

Another fellow-passenger was a former lieutenant of the Russian


navy, who, since the German occupation of Sevastopol, had been
acting as an agent of the Allies. He carried a complete list of the
German and Austrian ships and submarines in the Black Sea, and
details of the coast defences.

The three days' voyage was uneventful. The Black Sea remained at
its smoothest. A pleasant sun harmonized with the good-will and
friendliness of all on board, and with our deep content, as we
continued to tread on air and impatient expectation. A Bulgarian
destroyer pranced out to meet us, and led the vessel through the
devious minefields and into the miniature, toy-like harbour of Varna.
The Bulgarian authorities imposed a four days' quarantine upon all
passengers; but the general, the naval commander, and the Franco-
British agent joined with us in avoiding this delay by sending ashore
a collective note to the French naval officer who controlled the port.
As at Odessa, we rowed ashore with our complete luggage wrapped
in two newspapers, each of which contained a toothbrush, a
revolver, some cartridges, a comb, a razor, a spare shirt, a spare
collar, and a few handkerchiefs.

Outside the docks a British trooper in dusty khaki, shoulder-badged


with the name of a famous yeomanry regiment, passed at a gallop.
The sight of him sent an acute thrill through me, for he was a
symbol of all that I had missed since the day when I woke up to find
myself pinned beneath the wreck of an aeroplane, on a hillside near
Shechem.

White looked after him, hungrily. He had been among the Turks for
three years, and since capture this was his first sight of a British
Tommy on duty.

"How about it?" I asked.

"I don't know. Somehow it makes me feel nohow in general, and


anyhow in particular."

We reported to the British general commanding the force of


occupation, and gladly delivered ourselves of information about
Odessa for the benefit of his Intelligence Officer. At the hotel
occupied by the staff there were preliminary doubts of whether such
hobo-like ragamuffins could be British officers; but our knowledge of
army shop-talk, of the cuss words fashionable a year earlier, and of
the chorus of "Good-bye-ee" soon convinced the neatly uniformed
members of the mess that we really were lost lambs waiting to be
reintroduced to rations, drinks, and the field cashier.

For many days our extravagant shabbiness stood in the way of a


complete realization that we were no longer underdogs of the
fortune of war, but had come back into our own. Bulgarian officers,
their truculence in no way impaired by their country's downfall,
wanted us to leave our first-class carriage on the way to Sofia.
Outside Sofia station it was impossible to hire a cab, for no cabman
would credit us with the price of a fare. The staff of the British
Mission, to whom we gave reams of reports, tried their politest not
to laugh outright at our clothes, but broke down before the green-
and-yellow check waistcoat, many sizes too large, which White had
received from a British civilian in Odessa.

Even the real Ford car, lent us by the British Mission for the journey
to Salonika, failed to establish a sense of dignity. Once, when we
stopped on the road near a British column, the driver was asked who
were his pals the tramps.

We drove joyously down the Struma valley and through the Kreshna
and Ruppel passes, still littered with the débris of the Bulgarian
retreat. Rusted remnants of guns lolled on the slopes descending to
the river. Broken carts, twisted motor-lorries, horse and oxen
skeletons—all the flotsam of a broken army—mottled the roadside.
In the rocky sides of the mountain passes were great clefts from
which dislodged boulders had hurtled down on the Bulgarian
columns when British aeroplanes helped the retreat with bomb-
dropping. We passed through the scraggy uplands of Lower
Macedonia, and so to Salonika.

The real Ford car halted in the imposing grounds that surrounded
the imposing building occupied by British General Headquarters at
Salonika. As we climbed the steps leading to the front door, warmly
expectant of a welcome by reason of our information from South
Russia, an orderly pointed out that this entrance was reserved for
Big Noises and By-No-Means-Little Noises. We swerved aside, and
entered an unpretentious side-door, labelled "Officers Only."

"Wojer want?" asked a Cockney Tommy, who sat at a desk inside it.

"We want to report to Major Greentabs, of the Intelligence


Department."

The Tommy looked not-too-contemptuously at our sunken cheeks,


our shapeless hats, our torn, creased, mud-spotted tatterdemalion
clothes, and almost admiringly at White's check waistcoat.

"Nah, look 'ere, civvies," he instructed, "yer speak English well inuf.
Carncher read it? The notice says 'Officers Only', an' it means only
officers. Dagoes 'ave ter use the yentrance rahnd the corner, so aht
yew go, double quick."

That day Salonika gave itself up to revelry by reason of an


unfounded report that an armistice had been signed on the Western
front. One of the celebrators was a certain 2nd-class air mechanic of
the Royal Air Force. We stopped him in the street, and asked the
way to R.A.F. headquarters. Beatifically he breathed whiskied breath
at me as he stared in unsteady surprise.

"George," he called to his companion, "the war's over—hic—and


here's two English blokes in civvies. Want to join the Royal Air Force,
they do." Then, tapping me on the chest—"Don't you join the Royal
Air Force. We're a rotten lot."

Armed with signed certificates of identity we went to the officers'


rest house to demand beds.

"Speak English?" said a quartermaster-sergeant as we entered.

"Yes."
"Been expecting you. The Greek contractor's sons, aren't you?"

Later, not long before the bulletin-board showed the rumoured


armistice with Germany to be premature, an orderly in the rest
house wished to share the great news that wasn't true with the
nearest person, who happened to be White. He stopped short on
seeing a dubious civilian. But his good-fellowship was not to be
denied. French being the lingua franca of the multi-nationalitied
troops in Salonika, he slapped White on the back and announced:
"Matey, la guerre est finie!"

Metamorphosed by ordnance uniforms from third-class scarecrows to


the regulation pattern of officer, we spent glorious days of rest and
recuperation. Then, by the next boat for Port Saïd, we left Salonika
the squalid for Cairo the comfortable; and so to the world where
they dined, danced, demobilized, and signed treaties of peace.
EPILOGUE

A DAMASCUS POSTSCRIPT; AND SOME WORDS ON THE


KNIGHTS OF ARABY, A CRUSADER IN SHORTS, A VERY
NOBLE LADYE AND SOME HAPPY ENDINGS

Of all the cities in the Near and Middle East Damascus is at once the
most ancient, the most unchanged by time, the most unreservedly
Oriental, and the most elusive.

Constantinople is Byzantium—cum Mohammedan lust for power—


cum Ottoman domination—cum Levantine materialism—cum
European exploitation and Bourse transactions, in a setting of
natural andarchitectural magnificence; a city that expresses itself
variously and inharmoniously by a blendless chorus from an
unmixable mixture of creeds and races; a charming, feminine city
with a wayward soul; a cruel, unstable city of gamblers; a city of
pleasant, vine-trellised alleyways, delightful waterways, fear-haunted
prisons and extravagant rogueries; to my mind the most intriguing
city in the world.

Cairo is a compound of sphinx-and-pyramid antiquity, modern


opulence, degenerate Arab touts, Arab Babudom, reserved and
Simla-like officialdom, the cosmopolitan gaiety of four great hotels,
sordid and curious vice, sand-fringed suburbs, traffic in tourists and
fake scarabs, and the compelling, changeless charm of the Nile.

Alexandria is bastard Byzantine-Levantine, with a wonderful past, an


insistent Cotton Exchange, a lovely harbour, a crooked racecourse
where crooked races are run, and a summer colony for Cairo's white-
ducked Westerns.
Port Saïd is a dull, heat-heavy hell, at which the traffic to the Far
East calls of unwelcome necessity, pays its tolls, skirts the green-
gray statue of De Lesseps, and gladly glides down the turquoise-
toned Suez Canal.

Suez is a hard-faced ex-courtesan, formerly famed for outrageous


spectacles, but now converted by that missionary of war-time
expedience the British Provost-Marshal into an unreal, uninviting,
hypocritical respectability; a harbour landlady for squat-sailed,
dancing dhows.

Mecca is the pilgrim city in excelsis, with a Holy Stone, overpowering


heat, much colour and squalor, a reputation for impenetrability, and
no traditions earlier than the birth of the Prophet.

Jerusalem has a stupendous history and is yet the most


disappointing city in the world; a small, gilded-gingerbread city with
no beautiful building except the blue-tiled Mosque of Omar, no first-
class view except that of the walls and roof-tops from the Mount of
Olives; a city trading its past for Western charity; a city with a rebuilt
Tower of David masquerading as the original, a probably authentic
relic in the Tomb of Absalom, and many dubious ones where, within
the space of fifty square yards of beflagged church-floor, mumbling
guides point out to pilgrims in pince-nez the supposed tombs of
Jesus of Nazareth, Joseph of Arimathea, and Nicodemus, hard by
the supposed site of Calvary, strewn with supposed fragments of the
Cross; a city sacred to three great religions, exemplified locally by
scheming town-Arabs; ring-curled, lethargic Jews aloof from their
Western kindred; and swarthy, lethargic Christians educated and
largely supported by Euro-American subsidies; a city of narrow,
denominational schools that ignore the Fellowship of Man; a city
whose Church of the Holy Sepulchre should be an epitome of peace
and good-will, but yet is a place where, in the name of Christian
charity, Catholic, Orthodox, Coptic, Armenian, and various kinds of
Protestant priests intrigue and squabble over claims to guard relics,
windows, and corners, and defray the cost of holy candle-light by
collecting from visitors enough money to burn a hundred and one
candles for one and a hundred years; a city better read about than
examined.

Bagdad is a city with a romantic name, some fine Arabian


architecture, and an impressive western gate whence the Damascus-
bound caravans move dustily across the desert; a city fallen from
greatness to the date and grain trade, minor bazaars, and the
steamer and dhow traffic of the broad-bosomed Tigris; a city
redolent of all that Haroun-al-Raschid was and modern
Mesopotamia's opportunist sheikhs emphatically are not; a city with
a prosperous future, thanks to the British engineers who have
irrigated the Tigris-Euphrates basin into the way it should go.

Mosul is an unlovely mud city that straggles around the ruins of


Nineveh the Magnificent.

But Damascus is indescribably a city with an unfathomable soul. In


its complex ancestry are the strains of many ancient civilizations.
The crooked alleys and decrepit buildings of its oldest quarter,
perched on a mountain projection high above Damascus proper,
have an origin lost in the conjectural mists of an epoch when the
written word was not. Another part of it was co-incident with
Baalbek and sun-worship. The plain façade of many a house
(purposely plain to divert the cupidity of Turkish pashas) hides a
wide, white courtyard soothed by fountains, the plashing of which is
coolingly heard in divanned rooms precious with rugs and hangings,
and ornamented by minutely detailed designs in fancy arches and
miniature cupolas—houses exactly as they were when tenanted by
rich merchants who flourished under the greater Arabian caliphs.
The Street called Straight, the glass-roofed, unique bazaar and a
dozen other city-marks are bafflingly suggestive of contact with a
dozen periods of greatness. And last year, when the demoralized
Turks marched out of the city under the Arab flag that flew defiantly
from the city gate, Arab thinkers began to dream of yet another
period of greatness, in which Damascus was to be the centre of a
re-united Arabian Empire….

My motive in returning to Damascus was threefold—certain minor


work at Air Force Headquarters, an unpraiseworthy resolve to buy
carpets and knick-knacks before other officers of the Palestine Army
chose their pickings from the merchants' war hoards, and a
sneakingly benevolent desire to see George, the mongrel interpreter
who had been bullied into betraying my escape plans in Baranki
Barracks, but who was yet such a pathetic little nondescript.

With a passenger I left Ramleh aerodrome in a Bristol Fighter; for


with an aeroplane available who would think of travelling by train or
automobile over the disordered rails and roads of Syria? It was a
sun-shimmery day, pleasantly cool in the early part of a Palestine
November. Everything suggested peace as we flew northeastward—
the calm cloudlessness, the silent, sparkling countryside, the
rhythmic purring of the motor. The ground mosaic was radiant with
that acute clearness which makes flying so much more interesting in
the East and Middle East than elsewhere.

Far away to the right we could see from our height of 6,000 feet the
ghostlike outline of the Dead Sea behind the bleak-ridged hills
beyond Jericho. To the left were the shining sea, white-roofed Jaffa,
and the lines of sand dunes that curved in and out of the coloured
country-side. Ahead and around were brown surfaces of grain land
and green blotches of woodland, interspaced with gray-gleaming
villages.

Soon the Bristol Fighter droned over what had been the old front of
Allenby's left flank, with uneven trenches snaking southeastward
from the sand-bordered coast to the Jordan basin. The Jordan itself
twisted and writhed through its green-and-gold valley, over which
occasional trenchworks zigzagged. Then came the hill desolation of
Lower Samaria. Near Shechem I reached out a fur-gloved hand and
showed my passenger the approximate spot where, seven months
earlier, I was shot down and awoke to find Arab nomads
approaching my wrecked machine. Slightly to the west was
Nazareth, perched pleasingly on high ground.

The pear-shaped Sea of Galilee flickered with iridescent twinkling in


the sunlight. Just north of where the river flows into the lake I
picked out the point at which a regiment of the Australian Light
Horse, confronted on the far bank by a Turco-German force sent
from Damascus to defend the ford, swam their horses across the
Jordan and routed the enemy.

The patchwork flatness below changed to more plains of gray-brown


grain-country and gray-green orchard land neighboured on the east
by the desert that was a populous province in the days when armies
of age-old civilizations—Assyrian, Babylonian, Medean, Persian,
Macedonian, and Arabian—swept backward and forward in waves of
conquest and counter-conquest, to and from Nineveh, Babylon,
Ctesiphon, and Old Bagdad, until the Turkish hordes swarmed across
from Central Asia and ruined all the lands they conquered.

Small and indistinct at first, then expanding into a vivid clearness as


we flew toward it, Damascus came into sight; and of all the views
from the air that I remember from flights in Palestine, Egypt, Syria,
France, Italy, Bulgaria, Greece, England, and America, this was
incomparably the loveliest.

Far away to the west was Mount Lebanon, and from it stretched a
line of mountains, growing ever bleaker as they neared the Syrian
Desert. The low ground dominated by the heights was a maze of
forests, wheat-fields, pasturage, and orchard land, intermingled with
patches of sand. Straight ahead was the ancient city of Damascus, a
straggling surface of white roofs pierced by the domes and minarets
of many mosques, all in a gray whiteness, as if powdered with the
dust of its four thousand years of history. Pharpar and Abana, the
twin rivers of Damascus, showed up plainly as, converging and
diverging, they descended from their sources on the rim of the
mountain, and lost themselves in the jig-saw of crooked streets and
square-topped houses. The background is the wide, shimmering
desert that loses itself on the eastern horizon.

Having, to the roaring accompaniment of a 1918 Hispano-Suiza


aero-engine, circled over this city half as old as time, I spiralled
down and landed on the aerodrome.

On horses borrowed from the Sikhs who guarded the aerodrome we


cantered towards the city, three miles distant. The road was utterly
vile, for apart from Turkish neglect it had for three years been
dented and spoiled by German motor lorries. Every few yards we
had to edge our horses round some large hole.

Inside Damascus long-disused tram-lines rose high above the


roadway. Through the narrow, winding streets there streamed a
medley of camels, horses, fat men riding on thin donkeys, goats,
rainbow-robed Bedouins, veiled women in black, and fezzed Syrians
and Armenians. All of them—camels, donkeys, horses, and humans
—wound in and around each other without any pretence at order.

Under such conditions the least mishap is enough to bring about a


block in the haphazard traffic. We were held up for nearly twenty
minutes when a donkey, with a huge load of wood straddled on its
back, lay down near a hole in the road, and refused to budge. Men,
women, and animals mingled confusedly, and exhortation and
imprecations were flung at the donkey and its master. The onlookers
were raining advice as we halted our horses on the rim of the crowd,
but none made an attempt to help. And the following is an
approximate but far from literal translation of a few remarks:

"O thou unfortunate one! He has a donkey with a stubborn spirit. It


has deposited itself on the ground and most annoyingly refuses to
rise."

"Beat it hard, I say! I have a string of camels which become unruly


because they cannot proceed. Beat it, I say!"

"Nay, rather speak kindly and apply gentle pressure to the under-
parts. Then will it lift its forefeet and stand erect. Stubborn donkeys
care naught for blows."

"Cow-faced son of an exceedingly fat she-dog! Displace thy heavy


hoof from my astonishingly painful toes!"

"Ah-ee! Ah-ee! But a moment hence I had a money-purse, and it


has left me."

"O thou unfortunate one! He had a money-purse, and it has left him.
O thou unfortunate one!"

And although all knew that the purse was probably hidden in the
folds of some Arab's robe, those near the unfortunate one searched
and scratched the ground, probably none more assiduously than the
man who could have produced it.

Now if the period had been two months earlier a Turkish gendarme
would have taken the donkey-owner apart, and, if he failed to offer
a bribe, shot his prostrate beast and hauled its carcase to the
roadside. As likely as not it would have been the gendarme who
stole the unfortunate one's money.

What actually happened was this. A sun-browned man in light khaki


tunic, short trousers, and bare knees sauntered along, a cigarette
drooping from the left-hand corner of his mouth.
"Saa-eeda, Tommy Effendi," said one of the loiterers, making way
for him.

"Damned old fool of a moke," said the man in shorts; then bent
down and alternately stroked, pushed, and spoke to the donkey.
Somehow he persuaded it to rise and start walking. The crowd
disentangled itself and its animals from each other, and dispersed.
And the man in shorts, his cigarette still dangling from the left-hand
corner of his mouth, passed on, as casual and unsurprised as if he
had been in Brixton or Birmingham.

Both in appearance and in spirit Damascus had changed much since


the days of my captivity. Destitution was yet evident, but far less
flagrantly than when I had seen starving babies lying against the
walls and crying their hunger. There were no more furtive looks, and
many more smiles. The swaggering Germans were supplanted by
companionable Tommies, the tyrannous Turkish gendarmes by the
headdressed Arab police. In the long, arcaded bazaar the traders
had brought out their stocks of carpets, prayer-rugs, silks, and
precious stones, hoarded during the war, and were selling them at
prices far below those ruling in war-time Cairo or war-time anywhere
else. And everywhere the Arabian flag was prominent.

For many a day the talk in the bazaars had been of a new Arabian
Empire, as a reward for the exploits of King Hussein's Arabs—
exploits that had not only freed Arabia and helped to free Syria, but
had involved the abolition of all blood-feuds in a thousand miles of
semi-lawless country. The Emir Feisul, son of King Hussein (and thus
a direct descendant of the Prophet), was on his way to the Peace
Conference in Paris, accompanied by Colonel Lawrence, the young
Englishman who was the soul of the Arab national revival, and of the
Arabs' epic campaigns between Mecca and Damascus. And many
citizens of Damascus were hoping that he would return with the
realization of their dreams that the city was to be the centre of pan-
Arabian greatness.
My enquiries at Baranki Barracks, and in the offices of the British
Provost-Marshal and the Arab gendarmerie, failed to trace the fate of
George; and I had to be content with the memory of a futile little
figure standing on the steps of our railway carriage, on the morning
after our betrayal, and saying, with despair in his voice: "I have so
little courage. I ask pardon."

Of the other intimate characters in the story I can account for all but
two. Jean Willi, the Israelite dragoman who was my benefactor at
Nazareth, has not yet given me the chance to pay back in part the
good deeds that I owe him; but I still have hopes. And I can only
guess at what has happened to Michael Ivanovitch Titoff, now
somewhere behind the screen which, since the Bolshevist
reoccupation of last spring, separates Odessa from the normal
world. From what I know of his character I am certain that when the
Soviet troops arrived he proclaimed himself a Bolshevist, and took
full advantage of the conditions whereby the unrighteous have
special opportunity to flourish.

Vladimir Franzovitch—a Russian as estimable as Michael Ivanovitch


was despicable—died for the country he loved and despaired of,
fighting in Denikin's army.

For the rest, I can offer happy endings as conventionally apposite as


those of the worst "best-seller" of any lady novelist.

Miss Whittaker, the noble girl who played in Constantinople the


heroic part of an Edith Cavell, is now Lady Paul. Less than a month
ago an American warship took her from Constantinople to Beyrout,
where she married Captain Sir Robert Paul, one of the British officers
whom she had helped to escape. She now lives in Aleppo, where
Paul commands the Arab gendarmerie. In this crowded narrative I
have failed to do justice to the brave and gifted woman who many
times risked liberty and life in aiding unfortunate countrymen; but
only because the last thing she would desire is advertisement have I
refrained from writing the eulogy she deserves.

Another happy ending, almost too good to be true, was the recent
wedding of Colonel Newcombe and Mlle. "X", the girl who arranged
his escape from Broussa and concealed him in Constantinople while
he worked for a withdrawal of Turkey from the war.

Mr. S., the British merchant who jeopardized his neck in helping no
less than seven British officers to liberty, has returned to England,
and should be conscious of much merit.

The Turkish armistice happened a few days before Theodore was to


have been hanged. Fulton and Stone were released from the
Ministry of War Prison, and twenty-four hours later, by means of
threats, they obtained reprieve and freedom for the Greek waiter
who had hidden them. He was then half dead, as a result of
insufficient food, and of the dreadful, disease-ridden, insanitary,
crowded state of his dungeon; but he recovered under careful
nursing, and returned to his mother and sisters, in the house where
the gendarmes had captured Yeats-Brown, Fulton, and Stone.

The Maritza restaurant, near Stamboul station, still flourishes; but


Theodore is no longer there. With the money gained by acting as
conspirator-in-chief for British prisoners, he talks of coming to
London and opening a small restaurant of his own. If this happens,
he can count on regular customers from among those who saw him,
with his bent shoulders and blue-glassed spectacles, flicking a secret
letter on to the tablecloth, under cover of a menu-card.

Those of us who schemed, escaped, hoped, feared, wore disguises


and whiskers, assumed illnesses and insanities, suffered, and
amused ourselves generally are dispersed over five continents.
Fulton and Stone are still in Constantinople, but as responsible
officials instead of under-dogs of war. White is a quiet-living
manufacturer in Melbourne. Hill and Jones, the madmen of Yózgad,
Haidar Pasha, and Gumuch Souyou have gone their demobilized
ways in sanity and content, one to Sydney, the other to Glasgow.
Paul is in Syria, Colonel Newcombe in Egypt. Yeats-Brown, ex-Mlle.
Josephine Albert, is in London, with an eyeglass which he kept intact
through three years of adventurous captivity, from the day when he
was taken prisoner near Bagdad to the day when, from the verandah
of his hiding-place opposite the deserted British Embassy in
Constantinople, he looked along the Grande Rue de Pera and
learned, from the fluttering Allied flags, that the Turkish armistice
had been signed. Last and least, I am now in civilian blessedness
and America.

Often I have left the satisfying solidity of London, the restful beauty
of a Thames backwater, the comforting hospitality of New York, the
wealth-conscious heartiness of Chicago, to hear the chanted
summons to prayer from the minaret that faced my prison in
Damascus, watched the intrigues that coloured Constantinople
during the twilight of the Turkish Empire, discuss Bolshevism and the
price of revolvers with Vladimir Franzovitch, as he sits on a camp
bed in his tiny room at Odessa.

And Time, the greatest of romantics, has nearly persuaded me to


disregard memory and believe that I enjoyed it all.

THE END
THE COUNTRY LIFE PRESS
GARDEN CITY, N.Y.
*** END OF THE PROJECT GUTENBERG EBOOK EASTERN NIGHTS -
AND FLIGHTS: A RECORD OF ORIENTAL ADVENTURE. ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and
with almost no restrictions whatsoever. You may copy it,
give it away or re-use it under the terms of the Project
Gutenberg License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country
where you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like