Hdt B

005.369—dc21 2001030707

Printed and bound in the United States of America. 123456789 QWT 6 5 4 3 2 1 Distributed in Canada by Penguin Books Canada Limited. A CIP catalogue record for this book is available from the British Library.

Microsoft Press books are available through booksellers and distributors worldwide. For further information about international editions, contact your local Microsoft Corporation office or contact Microsoft Press International directly at fax (425) 936-7329. Visit our Web site at mspress.microsoft.com. Send comments to [email protected].

ActiveX, FrontPage, IntelliSense, JScript, Microsoft, Microsoft Press, MS-DOS, MSDN, Outlook, PivotTable, PowerPoint, SharePoint, Visio, Visual Basic, Visual C++, Visual InterDev, Visual Studio, Windows, Windows Media, and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Other product and company names mentioned herein may be the trademarks of their respective owners.

The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred.

Acquisitions Editor: David Clark Project Editor: Devon Musgrave Technical Editor: Marzena Makuta Web Developer: Charlie O'Donovan Content Test Editor: Leslie Phillips

Body Part No. X08-06066

To my wife, Susan Cohen Byrne— your laughter, wisdom, and compassion have made the task easier.

To my daughters, Lily and Zoe, who make me a very proud dad and always provide a new perspective.


If there was ever any doubt that Microsoft Outlook is the world's most widely used programmable e-mail application, that uncertainty evaporated in May, 2000, when millions of people found messages of affection in their Inbox folders, sometimes from complete strangers. What came to be known as the I Love You or LoveLetter virus—and the many similar viruses that subsequently targeted Outlook—demonstrated just how easy it is to write programs that automate Outlook

Maybe too easy, concluded Microsoft. As a result, a security patch was issued for Outlook 98 and Outlook 2000, and Microsoft built those security features into Outlook 2002. Dealing with the changes to Outlook automation imposed by these new security features is the single biggest challenge facing Outlook 2002 developers. In this book, you'll find details on how to handle the prompts that the "object model guard" presents to users, how to use the tools for Exchange Server and HP OpenMail environments that allow administrators to trust specific COM Add-ins and selectively turn off the object model guard prompts, and what alternatives are available in situations in which the administrative tools cannot be used.

Despite the tighter security prompted by a world now wary of mail-borne viruses, Outlook remains the most customizable e-mail program available. Independent software developers have built hundreds of applications that either enhance Outlook with new capabilities—such as automatically compressing attachments in mail messages—or use Outlook as the foundation for complex programs that combine Outlook data with information from other sources. Corporate developers have extended Outlook in thousands of additional projects involving custom forms, Exchange Server scripts and event sinks, and COM Add-ins.

Besides being a more secure environment, Outlook 2002 offers some long-awaited object model improvements, including programmable views and searches and new folder properties that facilitate building applications both in Public Folders and for offline use. Outlook's ability to take an Exchange Server-based application off line is one of its critical strengths and has spawned many customer relationship management programs that help a "road warrior" manage data during his or her travels and automatically synchronize it with the server.

Above all, you'll find this book a very concrete guide to application development with Outlook. Randy Byrne is one of those people who isn't content to know only what the program does but wants to explore much further to discover how it might meet practical business and other goals that Outlook developers bring to their projects.

Sue Mosher Slipstick Systems, Arlington, VA httpJ/www. slipstick. com


This book was almost an entirely different book, but that is another story that does not bear telling here. I want first to thank Chris Kimmell of Microsoft for extending the invitation to write the Outlook 2002 version of this book. Other current and former members of the Outlook team in Redmond deserve thanks for their contributions, including Michael Price, Paul Steckler, Dan Battagin, Ronna Pinkerton, Bill Jacob, Chad McCaffery, Abdias Ruiz, Aaron Hartwell, Florian Voss, Don Mace, David Raissipour, and Brian Trenbeath. On the Exchange team, I've learned from the contributions of Jamie Cool, Jeff Wierer, Mindy Martin, Thomas Rizzo, KC Lemson, Jim Reitz, and the incomparable Charles Eliot. Finally, I want to acknowledge the assistance of Kay Williams and Paul Garner, lead program managers of the Outlook team, and Steven Sinofsky, Senior Vice President of Office. They provided access to material that made this a better book.

Apart from the Outlook team, I want to acknowledge the Microsoft Most Valued Professionals (MVPs) on the Outlook newsgroups who volunteer their time and effort to answer postings from Outlook users. Their ultimate goal is to make Outlook a better product. Thanks to all the members of the Outlook lunatic asylum, including Sue Mosher, Ken Slovak, Jay B. Harlow, Vince Averello, Hollis D. Paul, Jessie Louise McClennan, Ben M. Schorr, Milly Staples, Diane Poremsky, Bill Rodgers, Patricia Cardoza, Russ Valentine, Steve Moede, and the wizard of Extended MAPI, Dmitry Streblechenko. You all have helped me to comprehend pieces of Outlook that escaped my notice or understanding. In the MVP community, I send an immense thank you, once again, to Sue Mosher of Slipstick Systems, whose energy and commitment to Outlook and Exchange is unsurpassed. From the early preview of Office XP through the final beta, Sue has provided a sounding board for ideas and has always provided a clear perspective on developments in the world of Outlook and Exchange. For those of you who live by Outlook (both literally and figuratively), you know that there aren't enough superlatives to describe Sue's contributions.

There are peers who also enriched my knowledge of Outlook, Exchange, and SharePoint Portal Server. I'd like to thank Richard Wakeman, Robert Ginsburg, and Andy Sakalian of IT Factory (formerly ECMS). Additional thanks go to Phil Seeman of TeamScope Software, Jan Cirpka of Compaq Global Services, and Siegfried Weber of CDO Live. Finally, special thanks to David Kane, Vice President of Development at Micro Eye, for providing patient answers to my questions concerning the integration of Outlook with Web technologies.

Because a book of this type is by its very nature a group effort, I want to thank the Microsoft Press team behind this book. Thanks to David Clark, my acquisitions editor, for pushing this title through the approval process. Devon Musgrave, my project editor, deserves kudos for keeping me on track and on schedule. You actually made this book like a comfortable ride to an alluring destination instead of a slow uncontrolled descent into the underworld. Marzena Makuta was the technical editor and provided a sharp eye for code and technical errors. Michelle Goodman did the manuscript editing and Holly Viola the copyediting. Dan Latimer served as the principal compositor. Michael Victor pitched in as the buildmaster for the companion CD. Again, I thank all the team for their professionalism and enthusiasm. You did a great job, guys!

For encouragement and support during the writing of this book, I want to thank the following friends and family: Marie Byrne; Barry Byrne, MD; Lou and Harriet Cohen; Davide Atenoux; Chuck Schultz; Susan Brown; Steve Ekstrom; Steve Cohen; Laura Hogan; Karen Kane; Jerry Kaplan; Fern Friedman; and Susan Chainey.

Introduction - Who Should Use This Book

This book is designed primarily for Microsoft Outlook application developers using Microsoft Exchange Server. Many of the examples assume that you'll be deploying workgroup applications in an Exchange Server environment using both public and private folders. It's also assumed that you'll be using Outlook 2002 to run the applications in this book. Although many of the techniques discussed in this book can be used in prior versions of Outlook, you won't be able to take full advantage of the code examples and sample applications unless you've installed Outlook 2002.

Part I, "Introducing Microsoft Outlook 2002," provides you with a broad perspective on what you can accomplish using Outlook as a development platform. You'll learn about some tools and add-ins included on the companion CD that will make your life easier as an Outlook developer. In Part II, "Quick Guide to Building Applications," both programmers and nonprogrammers can pick up this book and find the information they need to develop groupware applications. Part III, "Building Blocks of Applications," gives you a solid foundation on which to build more complex Outlook applications. You'll understand that Outlook applications are developed using the core objects of messages and folders, and you'll learn how to customize Outlook forms to create an Outlook application.

In Part IV, "Beyond the Basics," you'll learn how to use events in the Outlook object model to write event-aware code. After an introduction to the Outlook development environment, you will be able to write Microsoft Visual Basic or Microsoft Visual Basic Scripting Edition (VBScript) code to create more sophisticated applications than you can using Outlook's built-in modules. You'll learn about the critical Outlook E-Mail Security Update that is built into Outlook 2002 and how you can work with this component of Outlook to protect your personal and private data from e-mail worms and viruses. I'll also extend what you've learned in a complete customer relationship management (CRM) sample application that operates both on line and off line. Part V, "Advanced Topics," is for developers who are at an intermediate or advanced level in Visual Basic. Step-by-step instructions are included that show you how to create COM Add-ins that replace Exchange Client Extensions and provide Outlook functionality that you only dreamed of in the past. You'll learn about the new Outlook 2002 View Control, folder home pages, and integrating Outlook with Digital Dashboards and Web Parts. Finally, you'll see how to add document management and powerful search capabilities to your Outlook applications with SharePoint Portal Server 2001.

More Detail on How This Book Is Organized

This book consists of the following five parts and sample applications.

Part I Introducing Microsoft Outlook 2002

Chapter 1. "Applications You Can Create with Outlook," discusses the processes and problems best suited for Outlook solutions and shows you the kind of Request, Discussion, Tracking, and Reference applications you can build to streamline communications in your organization. Chapter 2. "Outlook Design Tools," showcases the tools available for creating Outlook forms and for building COM Add-ins and folder home pages by using Microsoft Office XP Developer, Visual Basic, and Microsoft Visual InterDev. Chapter 2 also introduces you to evaluation versions of important third-party tools and Microsoft SDKs that are included on the companion CD.

Part II Quick Guide to Building Applications

Chapter 3, "Customize Built-in Modules," shows you how to create instant groupware applications by modifying the built-in Contacts application, customizing it for tracking customer correspondence related to a beta program, and then copying it to Public Folders on Exchange Server. Chapter 4, "Design a Custom Application," shows you how to build a Discussion application called Product Ideas that makes it possible for users to submit, read, and respond to new products ideas.

Part III Building Blocks of Applications

Chapter 5, "Forms," introduces the form design process, and covers fundamental form design tasks such as adding controls and fields, creating new actions, setting form properties, and publishing forms. Chapter 6, "Controls, Fields, and Properties," covers the fundamental skills and information you need to effectively use controls, fields, and properties on a form. It also explains the unique features of each commonly used control, and then offers some strategies for implementing these controls and fields in an application. Chapter 7, "Actions," discusses the easiest way to create responses for Message forms, explains how to create custom Reply actions for Message forms, and then shows how to create custom Reply To Folder actions for Post forms. Chapter 8, "Folders," takes an in-depth look at the folder design process, discusses how to make a folder available for offline use, and explains how to create custom views and folder home pages. It also covers setting folder permissions and building rules.

Part IV Beyond the Basics

Chapter 9. "Raise Events and Move to the Head of the Class," explains how you can use all the new events in the Outlook Object Model to write event-aware code in Outlook Visual Basic for Applications or an Outlook COM Add-In. Chapter 10. "The Outlook Development Environment," introduces the Outlook Script Editor for VBScript code behind Outlook forms. This chapter also discusses debugging with the Microsoft Script Editor and shows you the object models used in Outlook development. Chapter 11. "Using Visual Basic, VBA, or VBScript with Outlook," introduces VBScript and provides a wide variety of code examples for the most commonly performed tasks using VBScript or Visual Basic in Outlook. Chapter 12. "The Northwind Contact Management Application," demonstrates how you can apply what you've learned so far in a reusable Customer Relationship Manangment (CRM) application designed for online and offline use. Chapter 13. "Distributing and Securing Applications," shows you how to distribute forms in folders and provides some techniques for maintaining and securing applications. This chapter also discusses the critical areas of Outlook Object Model and attachment security and illustrates how the Outlook E-Mail Security Update has been integrated into Outlook 2002. Finally, you'll learn how your current and future applications can coexist with the Outlook E-Mail Security Update.

Part V Advanced Topics

The Advanced Topics chapters are primarily for developers who want to use Visual Basic to extend Outlook in a corporate environment where Exchange Server is installed. Chapter 14, "Creating COM Add-lns with Visual Basic," provides you with practical templates for Visual Basic COM Add-in component creation and discusses the security issues associated with COM Add-ins. You'll also learn how to use Visual Basic to create an ActiveX control that serves as a property page in the Outlook Tools Options dialog box. Chapter 15, "Integrating Outlook with Web Applications," shows you how to use the Outlook View Control in Web pages. You'll also learn how to create Digital Dashboard Web Parts for the Northwind Contact Management Application. In Chapter 16, "Using Outlook with SharePoint Portal Server," you'll discover how you can use the PKMCDO Object Model for document check in, check out, and versioning. You will be able to integrate the Northwind Contact Management application with SharePoint Portal Server document management and search.

Sample Applications

The sample application for this book is in the Building Microsoft Outlook 2002 Applications personal folders (.pst) file on the CD that accompanies this book. You can modify the sample Northwind Contact Management application for use in your organization. The Northwind Contact Management application is a CRM application created in Exchange public folders, and is suitable for both online and offline use. This application is extended in the Advanced Topics chapters of the book. You can integrate the Northwind Contact Management application with the Digital Dashboard Resource Kit 3.0 and with SharePoint Portal Server 2001 as shown in Figure 1-1.

Company WeL"1 h lag tor hollow Up Collapse All bxpand All


Was this article helpful?

0 0

Post a comment