Home > Store

Developing Applications Using Outlook 2000, CDO, Exchange, and Visual Basic

Register your product to gain access to bonus material or receive a coupon.

Developing Applications Using Outlook 2000, CDO, Exchange, and Visual Basic

Book

  • Sorry, this book is no longer in print.
Not for Sale

Description

  • Copyright 2000
  • Edition: 1st
  • Book
  • ISBN-10: 0-201-61575-4
  • ISBN-13: 978-0-201-61575-3

"This is the 'must have' book for programming with Outlook and CDO. This book provides the details, tips, and cautions that can save you time and frustration when building collaborative applications. So if you like 'the best' in your technical library, get this book." --Deborah Kurata, InStep Technologies, Inc.

Written for IT developers who build collaborative and workflow applications, this book provides a comprehensive reference to working with Microsoft's powerful collaborative development environment, including Outlook 2000, Exchange Server, Visual Basic, and the Collaboration Data Objects (CDO) Library. It demonstrates ways in which these technologies can be tied together into effective business solutions--from small-scale groupware to large-scale enterprise-wide systems.

Developing Applications using Outlook 2000, CDO, Exchange, and Visual Basic offers an overview of the Microsoft collaborative landscape, and then examines each element of that environment in detail. Numerous examples showcase the applications made possible with these technologies and demonstrate VBScript coding techniques. You will find in-depth information on such important topics as:

  • properties, methods, and events available in Outlook 97, 98, and 2000
  • the Outlook 2000 object model
  • working with Outlook 2000 mail, calendar, task, and address book capabilities
  • VBA and COM add-ins
  • using Outlook Forms and VBScript
  • Outlook web access
  • the Forms 2.0 to HTML converter tool
  • the CDO rendering object model
  • Exchange agents and routing objects

In addition, this book shows how a number of outside technologies can extend the capabilities of the Outlook/Exchange development environment, including Active Directory (ADSI) services, SQL Server, and ActiveX Data Objects (ADO). The examples include approving purchase order reports using Exchange, maintaining a corporate directory using Outlook and SQL Server, and building an eCommerce application with Exchange and SQL Server.

A comprehensive supporting Web site, including sample code and Visual Basic project files, can be found at http://www.MMAnet.com/OutlookExchange.



0201615754B04062001

Downloads

Source Code

Source Code and Online Resources

source code for the examples in the book

Sample Content

Table of Contents



Foreword.


Preface.


Acknowledgments.

I. GETTING STARTED.

= 1. Overview of the Collaboration and Communication Architecture.

Introduction to Collaborative Systems.

Outlook 2000.

Collaboration Data Objects.

Using Outlook versus CDO.

Microsoft Exchange Server.

Overview of MAPI.

Other Collaboration Components.

How the Pieces Fit Together.

Summary.

II. MICROSOFT OUTLOOK 2000.

= 2. Outlook Forms and VBScript.

Overview of Outlook Forms.

Putting Code behind an Outlook Form.

Versioning.

Password Protection.

Saving Outlook Forms.

Distribution.

Accessing Forms through Code.

Overview of Forms/VBScript Limitations.

Changing Forms for Existing Items.

Tips for Outlook Forms/VBScript Development.

Displaying Information: Views.

Reporting.

Additional Examples.

Summary.

3. The Outlook 2000 Object Model.

The Object Model.

Application Object.

User Interface Objects.

Accessing Outlook Data.

Additional Outlook Development Features.

Accessing the Mail Control Panel in Code.

Integration with Microsoft Access.

Conclusion.

4. MailItems and PostItems.

MailItems.

PostItems.

MailItem and PostItem Properties.

MailItem and PostItem Methods.

MailItem and PostItem Events.

Summary.

5. AppointmentItems and TaskItems.

The Outlook Calendar: Appointments and Meetings.

How AppointmentItems and MeetingItems Work Together.

AppointmentItem Properties.

AppointmentItem Methods.

AppointmentItem Events.

Creating Custom Appointment Forms.

The Outlook Tasks List: TaskItems.

How TaskItems Work.

TaskItem Properties.

TaskItem Methods.

TaskItem Events.

Summary.

6. Contacts and Distribution Lists.

Contacts, Recipients, and AddressEntries.

Contact Items.

The Recipient Object.

Distribution List Items.

Summary.

7. VBA, COM Add-Ins, and Custom Property Pages.

Visual Basic for Applications.

COM Add-Ins.

The COMAddIns Collection.

Using COM Add-Ins to Implement Property Pages.

Deployment.

Summary.

III. COLLABORATION DATA OBJECTS AND EXCHANGE.

8. Microsoft Exchange Server.

Introduction.

Exchange's Core Components.

Other Exchange Services.

Setting Up Exchange.

Exchange Administrator Program.

Configuring Mailboxes and Public Folders.

Exchange Objects.

Summary.

9. Collaboration Data Objects.

What CDO Provides.

The CDO Objects.

At the Top: The Session Object.

The InfoStores Collection.

Folders and the Folder Object.

Messages and the Message Object.

Discussion Group Support.

Calendar Support.

Address Books.

The Address Book Objects.

The AddressEntry Object.

CDO for NT Server.

CDO for Windows 2000.

CDO for Exchange Platinum.

Summary.

10. Accessing Exchange Using the Web.

Outlook Web Access.

The Frameset Design-Time Control.

The HTML Form Converter.

Exchange Web Example.

The CDO Rendering Library.

Security Considerations.

Server Location Considerations.

Web Access Performance.

Summary.

11. Exchange Agents.

Tech Check.

Uses for Exchange Agent Scripts.

Assigning Permissions.

Events.

Behind the Scenes.

Asynchronous Execution.

Example of Exchange Agent Calling a COM Component.

Creating an Agent.

Installing an Agent.

Debugging Scripts.

Under the Hood.

Limitations.

More Examples.

Conclusion.

12. Exchange Server Routing Objects.

Tech Check.

Using Routing Objects for Workflow.

Architecture of Routing Objects.

The Routing Engine.

The Routing Wizard.

Routing Objects Object Model.

Process Map Actions.

Creating the Process Map.

Tips and Caveats for Successful Routing.

Conclusion.

IV. MISCELLANEOUS TOPICS.

13. Outlook or CDO: Deciding Which to Use.

Okay, So Which One Do I Use?

The Object Model Structures.

Comparison of the Two Models.

Summary.

14. Using Active Directory Services Interfaces with Microsoft Exchange.

Tech Check.

The Lightweight Directory Access Protocol.

The Object Schema.

The ADSI Object Model.

ActiveX Data Objects.

Example: Changing Employee Information.

Conclusion.

15. Data Access Technologies: ActiveX Data Objects and OLE DB.

The Exchange and Outlook Message Stores.

Universal Data Access.

Using ADO to Read Contacts from a Database.

Accessing Data with an Exchange OLE DB Provider.

Summary.

16. Site Server and Knowledge Management.

Tech Check.

Exchange and Site Server.

Site Server Implementing Index Server.

Using Site Server to Index Data.

Working with Catalogs.

Site Server Configuration and Administration.

The MSSearch.Query Search Object.

Conclusion.

17. Using Microsoft Transaction Server with Exchange Agents.

Tech Check.

Overview of Microsoft Transaction Server.

HOW MTS Relates to Exchange.

Installing and Implementing MTS.

Conclusion.

V. SAMPLE APPLICATIONS.

18. The CdoExplorer Application.

Overview of the Application.

A Look at the Code.

Building the Folder Tree.

Listing Properties.

Summary.

19. A Group Scheduling Application.

Description of the Business Problem.

Create a Custom Outlook Form.

Publish the Form to the Organizational Forms Library.

Creating the Visual Basic Application.

Putting It All Together.

Summary.

20. An Outlook Calendar Viewer Application.

Tech Check.

Description of the Business Problem.

Detailed Code Highlights.

Conclusion.

21. A Purchase Order Application Using Routing Objects.

Tech Check.

Description of the Business Problem.

Architecture of the Application.

Summary.

22. A Corporate Directory Maintenance Application.

Description of the Business Problem.

The Application in Action.

Initializing the EntryIDs.

Updating the Address Book.

Viewing Updated Properties.

Putting It All Together.

Summary.

23. An eCommerce Workflow Application.

Tech Check.

A Closer Look at the eCommerce Application.

Behind the Scenes: the Code.

Summary.

Additional References.

Index. 0201615754T04062001

Preface

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 as components 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.



0201615754P04062001

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020