Microsoft Office 2000/Visual Basic Programmer's Guide |
This guide is for developers who are creating custom solutions based on Office 2000 applications. These developers form a large and diverse group. We use the term "developer" to include someone doing something as simple as creating a basic VBA procedure as well as someone working on a complex vertical-market solution. What Office developers have in common is that they all use the programmability features of Office technologies.
The Microsoft Office 2000/Visual Basic Programmer's Guide is for people looking for answers to Office-based development questions. This book can be used as a reference to answer those hard questions that come up time and again, or this book can be used as a learning tool, which when read from cover to cover, teaches important concepts in application development and design, code maintainability and reusability, and application security and distribution.
But this book is not for everyone. To cover such a wealth of material in a useful manner, we had to make certain assumptions about your level of knowledge. If you are not familiar with the concepts mentioned in the "What You Should Already Know" section later in this preface, this is not the book for you. Your time (and money) will be better spent with one of the many fine introductory resources available for the beginning VBA developer, such as the Mastering Office 2000 Development CD-ROM, or any of the other introductory references mentioned in the "Other Resources" section later in this preface. Then, when you have mastered the fundamentals, you can come back to the Microsoft Office 2000/Visual Basic Programmer's Guide to take full advantage of the programmability features in Office 2000.
This guide teaches developers how to work with the applications and components in the Microsoft Office 2000 suite (Microsoft Access, Microsoft Excel, Microsoft FrontPage®, Microsoft PowerPoint®, Microsoft Outlook®, and Microsoft Word). All the VBA code samples throughout this guide are compatible with this version of Office. All the VBScript examples are compatible with Microsoft Internet Explorer 5, which ships as part of Office 2000. As needed, notes describe differences between the Office 2000 applications and earlier versions.
The goal of this guide is to enhance your existing knowledge of the Office applications. We assume you're comfortable with the VBA language and that you understand data types, variable scoping, and how to use the Visual Basic Editor. The VBA code samples are written in VBA version 6.0, which is supported by Microsoft Visual Basic version 6.0, all the Microsoft Office 2000 applications, and other VBA 6.0 host applications. Most of the HTML scripting examples are written in VBScript; a few are written in Microsoft JScript®.
To understand the Web-related technologies in Office 2000, we assume that you have a basic knowledge of HTML and a basic understanding of how scripting works in Web pages. In addition, we assume you know about HTML intrinsic controls as well as how to use ActiveX controls on a Web page.
Many Office-based solutions are designed to manipulate data in one form or another. We assume that you are familiar with the concepts of relational databases and queries and know something of Structured Query Language (SQL) and programmatic data access. A large part of the data access discussion deals with ActiveX Data Objects (ADO). Although we do not assume you are already familiar with ADO, we do assume you have some knowledge of how to work with data programmatically by using Data Access Objects (DAO), Remote Data Objects (RDO), or Open Database Connectivity (ODBC).
Following are descriptions of the various resources you can use to get additional information about programming with VBA in Office.
Microsoft Office provides an extensive Help system for the VBA language, the objects that Office supports, and the properties and methods of those objects.
You can access Visual Basic Reference Help in any module in the Visual Basic Editor in any of the following three ways:
After you've displayed a Help topic, you can click the Show button in the Help window to display the navigation pane, which contains three tabs: Contents, Answer Wizard, and Index. You can then either look up a specific topic or language keyword by using the Contents or Index tab or ask a question by using the Answer Wizard tab.
Note If you turn off the Office Assistant, Help will behave slightly differently. When you click Microsoft Visual Basic Help on the Help menu, the Help window will appear with the navigation pane already visible. To turn off the Assistant, right-click the Assistant and then click Options on the shortcut menu (or click the Options button in the Assistant balloon) and then clear the Use the Office Assistant check box on the Options tab. (Clicking Hide the Office Assistant on the application's Help menu doesn't turn off the Assistant.) To turn the Office Assistant back on, click Show the Office Assistant on the Help menu in the application.
Microsoft Office also provides Help for the VBScript and JScript scripting languages, HTML, and the Dynamic HTML (DHTML) object model. These Help files (Vbscrip5.chm, Jscript5.chm, and Htmlref.chm) are available in the C:\Program Files\Microsoft Visual Studio\Common\IDE\IDE98\MSE\1033 subfolder.
Note The path to these Help files reflects the language ID folder (1033) for U.S. English language support in Office. The language ID folder below C:\Program Files\Microsoft Visual Studio\Common\IDE\IDE98\MSE\ differs for each language.
You can get useful and comprehensive information about developing solutions with Microsoft tools and technologies on the MSDN Online Web site at http://msdn.microsoft.com/developer/default.htm.
The latest information focused on developing custom applications for Office is available on the Microsoft Office Developer Forum Web site at http://msdn.microsoft.com/officedev/.
In addition to the Microsoft Office 2000/Visual Basic Programmer's Guide, Microsoft Press offers a number of books to help you understand VBA programming. For a listing of the current titles available from Microsoft Press, visit the Microsoft Press Online Web site at http://mspress.microsoft.com/.
In addition to books, Microsoft Press offers training and learning resources to help developers get the most out of Microsoft technology. The Microsoft Press Online Web site offers instant access to all Microsoft Press tools as well as news, chats with technical experts, and other information to help you become more productive quickly.
Mastering Office 2000 Development is a CD-ROM product available from Microsoft. You can use this self-paced training tool to become proficient with VBA, the Office 2000 object models, and more. More than 40 hours of labs, demos, sample code, and articles — plus valuable tips and techniques — get you up to speed fast, and the powerful Boolean search engine and comprehensive index make it easy to find just the information you need when you need it. Narrated demonstrations, animations, and interactive lab exercises walk you through complex concepts and help you design your own Office 2000-based applications.
At the end of each chapter in the Microsoft Office 2000/Visual Basic Programmer's Guide, there is a "Where to Go from Here" section, which provides a list of resources that contain more information about the topics covered in that chapter. Along with pointers to files on the Office 2000 Developer CD-ROM and various Web sites, the "Where to Go from Here" sections include references to many other books. For each book, we have referenced the most current version available at the time this guide was written, but because many of these books are updated when a new version of Microsoft Office is released, you may want to check for a newer version. Our intention in all cases is to reference the most up-to-date version of each book cited.