Page #174 (Programming Custom Solutions)

Chapter 30

Before discussing the Microsoft Project object model, the Visual Basic Editor, and other aspects of and tools for creating and editing code-based solutions in Microsoft Project, 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.

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.

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 Microsoft Visual Basic's Help files.
The Microsoft Developer Network (MSDN) at http://msdn.microsoft.com/ is also an excellent resource for programming guidelines, tips, and examples.

Installing VBA Help

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:

  1. Insert the Microsoft Project 2002 CD-ROM into your computer's CD-ROM drive.
  2. Open the Control Panel, and then double-click Add/Remove Programs.

    The name of this item might be slightly different for your operating system.

  3. Click Microsoft Project in the list of installed programs, and then click Change.
  4. Click Add Or Remove Features, and then click Next.
  5. Expand the Office Shared Features item and then expand the Visual Basic for Applications item.
  6. In the Visual Basic Help list, click Run From My Computer.
  7. 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.



Microsoft Project 2002 Inside Out
Microsoft Project Version 2002 Inside Out (Inside Out (Microsoft))
ISBN: 0735611246
EAN: 2147483647
Year: 2003
Pages: 67

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net