Developing Applications with Outlook 2000, CDO, Exchange, and Visual Basic
Authors: Raffaele Piemonte, Scott Jamison
Venue:  (1999)

From the Book:When a brokerage house approached us to design an Outlook 97 application for its prospect management system, Office 97 was still in alpha testing; the client was what Microsoft calls an "early adopter." The early adopter program was developed to help corporations migrate to the newest technology available. Translated: They already had Microsoft Office 97 in its earliest possible release, as well as the backing of Microsoft priority support. The client was a Microsoft Enterprise customer that recognized the benefit of leveraging its investment in Office 97. Prior to our arrival, it had already researched more than a dozen sales force automation products. It decided that Outlook was the way to go. A large obstacle during development was how to create a form that contained 425 fields. We don't think that the folks at Microsoft ever dreamed that someone would try to build a form with so many fields. Microsoft supported us the whole way. And it corrected some minor issues for the beta version; we never had to redo a form from scratch, because the beta version was compatible with the alpha version. It's not often that you come across a development tool that is so stable in alpha. Microsoft took time to develop Outlook well before releasing it and ultimately distributed a tool worthy of building business applications. The latest version, Outlook 2000, is the most developer-friendly of all versions. Microsoft also enhanced the programmability features of Exchange Server (Exchange) to include workflow and routing features. Outlook is so versatile that you can build a groupware solution in a matter of hours. Moreover, you can use Outlook and Exchange ascomponents for a large-scale enterprise system. This book will help you to do all of this. Recent History of Messaging and Collaboration This section describes the evolution of messaging and collaboration products available from Microsoft and other vendors. Figure 1 shows the evolution of Exchange and Outlook in particular. Microsoft Mail Most mail systems prior to the release of Microsoft Exchange and Lotus v3.0 depended very much on the client machine. The result was slow response time and the risk of losing mail messages. Microsoft Mail was based on a shared file messaging system. Initially, it lacked a form development tool. Microsoft added the Electronic Forms Designer to facilitate form development, thereby allowing you to create forms using 16-bit Visual Basic (VB). Lotus Notes Lotus was the first company to introduce a collaborative platform. It designed its Notes product to perform most of the mail processing on the server. This allowed clients to use as many powerful servers as necessary to get the job done. Notes was also designed to allow groups or departments to work better together. Lotus not only got the client server mail system boom going; it also coined the term groupware. When IBM purchased Lotus, it acquired the ability to bundle Notes with hardware and other systems. Microsoft Exchange Microsoft spent many hours in design sessions listening to large enterprise customers in order to understand what they liked about Lotus Notes. It identified features that were missing in Microsoft Mail and sought to make Exchange the market's most reliable messaging and collaboration solution. Microsoft wanted to ensure that current customers could gradually migrate to Exchange from their existing mail systems. Lotus Notes, Lotus ccMail, Novell's GroupWise, and even mainframe mail systems such as PROFS and SYSM can be easily migrated to Exchange. The process that it uses for migration is fairly simple. If the migrating client has a cc:Mail system, it simply uses Exchange cc:Mail migration tools, which allow Exchange to emulate cc:Mail and thereby allow the cc:Mail clients to believe that they are still communicating with an existing cc:Mail installation. This type of integration allows Exchange and any of the other mail systems to run in tandem. After Microsoft had the messaging part of Exchange working, it began to think about collaboration. Collaboration applications prior to Exchange were mostly written in Lotus Notes, VB, or other development tools. Word from within Lotus was that the company wanted to build a tool that would function on a Windows desktop. The new tool would be a desktop information manager that would allow the user to work all the time from within this application. Around the same time, Microsoft went to the drawing board and created Outlook. Today, Outlook, a strong collaboration client, and Exchange, a strong messaging server, form a powerful team that facilitates messaging and collaboration requirements for applications worldwide. This book features key development tips for the Notes developer who needs to develop applications in Outlook and Exchange. While the two development environments share many of the same concepts, they have key differences that we note throughout the book. How This Book Is Organized This book is divided into five parts. Part I, Getting Started: Contains an overview of current technologies and of installation recommendations for the software needed to use the sample applications in this book. Part II, Microsoft Outlook 2000: Discusses the Outlook 2000, as well as Outlook 97 and 98, development environments. This part illustrates concepts at a high level, drills down to demonstrate techniques using code samples, and provides a thorough reference for the object model. Part III, Collaboration Data Objects and Exchange: Covers Exchange Server, the Collaboration Data Objects (CDO) library, and Active Serve Pages (ASP)/Exchange applications and introduces event scripting and Routing Objects. Part IV, Miscellaneous Topics: Discusses additional applications and techniques that can be used with Exchange and Outlook to enhance and extend their functionality. This part builds on the core chapters of Parts 2 and 3. Part V, Sample Applications: Offers a selection of examples that are featured at the book's Web site, reviewed step-by-step and with various coding techniques highlighted. In addition, chapters that contain sample applications include a Tech Check section, which instructs you on which platforms and applications need to be installed and whether specific permissions and security are needed. Contents of the Web Site The site (http://www.mmanet.com/OutlookExchange) contains information in a format that resembles this book's format. It includes a downloadable zip file with folders that match the chapters in the book. Each folder that contains code includes a readme.txt file that lists the contents of the chapter. Two additional zip files contain Visual MAPI, a shareware application that gives you the ability to see code mapped to different CDO functions, and the CdoExplorer, which allows you to examine folders, items, and properties (we discuss CdoExplorer in Chapter 18). Who Should Read This Book This book was written for several types of readers. The primary intended reader is the application developer. Administrators and IT managers, also, should find the book helpful. It uses VB as its primary language for its examples, so you will find it helpful to be familiar with that programming language. However, code that runs in an Outlook form or on an ASP must be written in VBScript. Most VB code can be easily used with little or no modification in applications written in Visual Basic for Applications (VBA) and with some modification in VBScript. The second intended reader of this book is the technical developer with a business vision. It drills down to the code level so that you can solve problems, as well as describes and demonstrates the practical uses that you might have for the code. We also want it to be a great reference bookthe one we wished we'd had when we started developing Outlook and Exchange applications. It is very frustrating to see a fellow VB developer who needs to generate an internal e-mail from the company's Web site carrying around the C++ MAPI book or a book on TCP/IP sockets. Outlook and Exchange development is fairly new. We wanted to educate developers on the power of using this extensive and often misunderstood development environment. Note: We recommend that you use a test Exchange Server when developing your applications and deploy them only when fully tested. We hope that this book is as useful to you as it was informative for us to write. Acknowledgments A huge thanks to the primary editor of the book, Erica Jamison. Her expertise helped make this book as good as it could be. Without Erica's guidance and patience, there would be no book. Thanks to the technical editing team, with special thanks to Darrique Barton, Martin Tirion, and Doug Wood for their amazing dedication to improving the technical details in the book. We would also like to thank Diane Bush, Dan Kasun, Robert Ginsberg, Steve Peschka, Jim Reitz, and Tom Rizzo for their help for various sections of the book. We would like to express heartfelt thanks to J. Carter Shanklin, Krysia Bebick, Michael Slaughter, Laura Michaels, and the entire Addison Wesley team, who gave us the opportunity to write this book. We are also very grateful to our colleagues at MMA, whose expertise and support are a constant reminder of why we enjoy building solutions. Their feedback and insight shaped much of this book. Raffaele: I would like to thank my wife, Jackie, and my two daughters, Lauryn and Marissa, for supporting me and being patient with my crazy schedule. Also for assisting with editing I would like to thank Candace Valvano. Scott: I would like to send thanks to Erica for putting up with my late nights and all-weekend-long work schedules, to Mauro Cardarelli, Andy Kawa, and Alex Gomez for putting the book through real-world testing, and to the MCP team. Thanks to the foosball gang (you know who you are) for your patience, input, and much-needed breaks.