Before discussing the Microsoft Office Project 2003 object model, the Visual Basic Editor, and other aspects of and tools for creating and editing code-based solutions in Project 2003, you must first understand some of the elements and principles of Visual Basic:
Objects, properties, methods , and events
Data types
Variables
Decision and loop structures
Procedures
Scope
As you develop your Visual Basic skills and move on to writing more advanced code, there are some general principles of software development that make writing code easier, faster, and less prone to error:
Using naming conventions for procedures and variables
Writing modularized code
Writing formatted code
Writing efficient code
Trapping errors
Finally, although much of the discussion presented here is necessarily at a relatively high level, given the overall focus of this book, the intent of this chapter is to provide an overview of the Visual Basic concepts you'll need to take full advantage of VBA in Microsoft Project without being forced to look for a separate reference. After you're comfortable with the information presented here, you should find that most of what remains to be learned in Visual Basic is simply an extension of what you already know.
Note | Although Visual Basic for Applications is used to collectively describe the programming language and environment included with Microsoft Project, the language itself is Visual Basic. For the remainder of this chapter, Visual Basic is used to refer to the language and its elements. |
Cross-References | For more information about these and many other Visual Basic concepts, see the topics under the heading "Visual Basic Conceptual Topics" in the table of contents of the Microsoft Visual Basic Help files. The Microsoft Developer Network (MSDN) at http://msdn.microsoft.com/ is also an excellent resource for programming guidelines, tips, and examples. |
By default, the Help files for VBA are automatically installed the first time you use them. Follow these steps if you want to install them now:
Insert the Microsoft Project 2003 CD-ROM into your computer's CD or DVD drive.
Click Start, Control Panel and then double-click Add/Remove Programs.
Note | The name of this item might be slightly different for your operating system. |
Click Microsoft Project in the list of installed programs and then click Change.
Click Add Or Remove Features and then click Next.
Expand the Office Shared Features item and then expand the Visual Basic for Applications item.
In the Visual Basic Help list, click Run From My Computer.
Click the Update button.
This installs several Help files, including those for the Microsoft Project object model, concepts and language reference specific to VBA in Microsoft Office and related programs, general Visual Basic concepts and language reference, and Microsoft Forms.