You are previewing Professional Outlook® 2007 Programming.
O'Reilly logo
Professional Outlook® 2007 Programming

Book Description

  • Written by one of the most popular and knowledgeable Microsoft Outlook MVPs, this book fills a void in the market for a professional-level Outlook programming book

  • Explains how to use the many new features of Outlook 2007's object model and offers honest advice from the author on how to deal with common shortcomings and pitfalls of Outlook

  • Addresses common workarounds for Outlook programming bugs and how to interface with Word, Excel, SharePoint, and Access

  • Discusses the new Object Model, Outlook forms, COM add-ins, security, and more

Table of Contents

  1. Copyright
  2. About the Author
  3. Credits
  4. Acknowledgments
  5. Introduction
    1. Who Is This Book For
    2. What Does This Book Cover?
    3. What You Need to Use This Book
    4. Conventions
    5. Source Code
    6. Errata
    7. p2p.wrox.com
  6. 1. An Introduction to Outlook 2007 Programming
    1. 1.1. Setting Up Outlook VBA
      1. 1.1.1. Setting Up Macro Security
      2. 1.1.2. Creating a Code-Signing Certificate
      3. 1.1.3. Reviewing the VBA Editor Interface and Options
    2. 1.2. Understanding Outlook
      1. 1.2.1. Outlook Profiles and Data Store
      2. 1.2.2. Outlook Sessions and Data Stores
      3. 1.2.3. Outlook Folders
      4. 1.2.4. Outlook Items
    3. 1.3. Outlook Data Storage
      1. 1.3.1. Accessing Data Stores Using NameSpace
      2. 1.3.2. Accessing Data with Tables
    4. 1.4. Outlook Data Display
    5. 1.5. Summary
  7. 2. What's New in Outlook 2007
    1. 2.1. The Unified Object Model
      1. 2.1.1. The PropertyAccessor
        1. 2.1.1.1. PropertyAccessor Syntax 1
        2. 2.1.1.2. PropertyAccessor Syntax 2
        3. 2.1.1.3. PropertyAccessor Syntax 3
        4. 2.1.1.4. PropertyAccessor Syntax 4
        5. 2.1.1.5. Accessing Multiple Properties
        6. 2.1.1.6. The Date/Time and Binary/String Methods
      2. 2.1.2. Stores and Storage Items
        1. 2.1.2.1. Working with Stores
        2. 2.1.2.2. Working with StorageItems
      3. 2.1.3. User Interface Objects
        1. 2.1.3.1. Views
        2. 2.1.3.2. NavigationPane, NavigationFolders, and NavigationGroups, and Modules
        3. 2.1.3.3. SelectNamesDialog
      4. 2.1.4. Accounts
    2. 2.2. Performance Improvements
      1. 2.2.1. Working with Tables Instead of Items
      2. 2.2.2. Filtering Tables
      3. 2.2.3. Table Default Columns
      4. 2.2.4. Table Limitations
    3. 2.3. Security
      1. 2.3.1. Trusted Code
      2. 2.3.2. Untrusted Code
    4. 2.4. The Importance of Using DASL
      1. 2.4.1. DASL Namespaces
      2. 2.4.2. Using DASL and JET Syntax
        1. 2.4.2.1. JET Syntax
        2. 2.4.2.2. DASL Syntax
        3. 2.4.2.3. CI Syntax
    5. 2.5. Summary
  8. 3. Outlook Development
    1. 3.1. The Application Object
      1. 3.1.1. New Methods, Properties, and Events
        1. 3.1.1.1. GetObjectReference
        2. 3.1.1.2. DefaultProfileName
        3. 3.1.1.3. IsTrusted
        4. 3.1.1.4. Context Menus
        5. 3.1.1.5. BeforeFolderSharingDialog
        6. 3.1.1.6. ItemLoad
      2. 3.1.2. Other Important Collections, Methods, Properties, and Events
        1. 3.1.2.1. CreateItem and CreateItemFromTemplate
        2. 3.1.2.2. NewMail and NewMailEx
        3. 3.1.2.3. Reminder and Reminders
        4. 3.1.2.4. Startup, MAPILogonComplete, and Quit
        5. 3.1.2.5. ItemSend
        6. 3.1.2.6. Version
    2. 3.2. The NameSpace Object
      1. 3.2.1. Exchange
      2. 3.2.2. Categories
      3. 3.2.3. Picking Folders
      4. 3.2.4. Picking Names
    3. 3.3. Summary
  9. 4. Outlook VBA
    1. 4.1. The Outlook VBA Project
      1. 4.1.1. The Project File
      2. 4.1.2. ThisOutlookSession
      3. 4.1.3. Macros and VBA Procedures
        1. 4.1.3.1. Subs That Are Not Macros
        2. 4.1.3.2. Subs That Are Macros
    2. 4.2. Macro Security
      1. 4.2.1. Security Levels
      2. 4.2.2. Signed Macro Code
    3. 4.3. Class Modules
      1. 4.3.1. ThisOutlookSession
      2. 4.3.2. User Classes
    4. 4.4. Code Modules
    5. 4.5. Office UserForms
      1. 4.5.1. Creating the Macro User Interface
        1. 4.5.1.1. The NoSubjectForm
        2. 4.5.1.2. The ToDoForm
    6. 4.6. Working with Outlook Events
      1. 4.6.1. Application Events
        1. 4.6.1.1. Startup
        2. 4.6.1.2. ItemSend
        3. 4.6.1.3. ItemLoad
        4. 4.6.1.4. NewMailEx
        5. 4.6.1.5. AdvancedSearch
      2. 4.6.2. Folder Events
        1. 4.6.2.1. BeforeItemMove
        2. 4.6.2.2. BeforeFolderMove
      3. 4.6.3. User Events
        1. 4.6.3.1. Code for the NoSubjectForm
      4. 4.6.4. Wrapper Classes and Collections
        1. 4.6.4.1. Using the NewInspector Event to Instantiate a Wrapper Class
        2. 4.6.4.2. Email Wrapper
        3. 4.6.4.3. Contacts Wrapper Class for Mark as Task
    7. 4.7. Macro Projects
      1. 4.7.1. Custom Rules
        1. 4.7.1.1. Family Rule
        2. 4.7.1.2. Context Menu Rule
      2. 4.7.2. Additional Macros
        1. 4.7.2.1. Check for Existing Contact
        2. 4.7.2.2. Check Today's To-Do List
        3. 4.7.2.3. Incomplete Tasks Search Folder
        4. 4.7.2.4. Overdue Tasks Search Folder
        5. 4.7.2.5. Importance Search Folder
        6. 4.7.2.6. Overdue Reminders Search Folder
    8. 4.8. Running and Distributing Macros
      1. 4.8.1. Running Macros
      2. 4.8.2. Distributing the VBA Project
      3. 4.8.3. Distributing Individual Macros
    9. 4.9. Summary
  10. 5. Outlook Forms
    1. 5.1. Working with Standard Forms
      1. 5.1.1. Forms Libraries
      2. 5.1.2. Published Forms
      3. 5.1.3. Form Customization
      4. 5.1.4. Advantages and Disadvantages of Custom Forms
        1. 5.1.4.1. Advantages of Custom Forms
        2. 5.1.4.2. Disadvantages of Custom Forms
    2. 5.2. Back to the Past: the Forms Development Environment
      1. 5.2.1. Using the Field Chooser
      2. 5.2.2. Using the Control Toolbox
      3. 5.2.3. Using the Code Window
    3. 5.3. Prototyping Forms Code in VBA
      1. 5.3.1. Simulating the Form Environment in VBA
      2. 5.3.2. Developing and Debugging Using VBA
    4. 5.4. Custom Form Walkthrough
      1. 5.4.1. Creating, Publishing, and Running a Form
      2. 5.4.2. Where to Publish Forms
      3. 5.4.3. Publishing Forms Using Code
      4. 5.4.4. Testing Code for the Form
    5. 5.5. Forms Management
    6. 5.6. Form Behavior
      1. 5.6.1. Trusted Forms
      2. 5.6.2. Active X Controls
      3. 5.6.3. Script in Forms
    7. 5.7. Form Regions
      1. 5.7.1. Form Region Locations, Properties, and Registry Settings
      2. 5.7.2. Form Region Walkthrough
    8. 5.8. Summary
  11. 6. COM Addins
    1. 6.1. Managed or Unmanaged Code?
    2. 6.2. IDTExtensibility2 and Trusted COM Addins
      1. 6.2.1. Version Differences
      2. 6.2.2. VB.NET Addin Implementations
        1. 6.2.2.1. VB.NET with VSTO
      3. 6.2.3. C# Addin Implementations
        1. 6.2.3.1. C# with VSTO
      4. 6.2.4. Addin Templates
    3. 6.3. Explorer and Inspector Event Handlers
      1. 6.3.1. Setting Up Explorer and Inspector Event Handlers
        1. 6.3.1.1. VB.NET
    4. 6.4. The OnDisconnection Catch-22 Bug
      1. 6.4.1. VB.NET With VSTO
      2. 6.4.2. C#
      3. 6.4.3. C# with VSTO
      4. 6.4.4. Explorer and Inspector Wrappers
        1. 6.4.4.1. Explorer Wrappers in VB.NET
        2. 6.4.4.2. Explorer Wrappers in C#
        3. 6.4.4.3. Inspector Wrappers in VB.NET
        4. 6.4.4.4. Inspector Wrappers in C#
    5. 6.5. Template Utility Code
      1. 6.5.1. VB.NET Utility Code
      2. 6.5.2. C# Utility Code
    6. 6.6. Displaying Outlook Property Pages
      1. 6.6.1. Displaying Property Pages with VB.NET
      2. 6.6.2. Displaying Property Pages with C#
    7. 6.7. Communicating with a COM Addin
      1. 6.7.1. VB.NET
      2. 6.7.2. Testing Addin Communications
      3. 6.7.3. C#
      4. 6.7.4. VSTO with VB.NET
      5. 6.7.5. VSTO with C#
    8. 6.8. Summary
  12. 7. COM Addins and the Outlook User Interface
    1. 7.1. Working with Menus and Toolbars
      1. 7.1.1. Menus and Toolbars in Explorers
      2. 7.1.2. VB.NET
      3. 7.1.3. C#
    2. 7.2. VSTO Interface Handlers
      1. 7.2.1. VB.NET
      2. 7.2.2. C#
    3. 7.3. AxHost
      1. 7.3.1. VB.NET
      2. 7.3.2. C#
    4. 7.4. Working with the Ribbon
      1. 7.4.1. Ribbon XML
        1. 7.4.1.1. Ribbon Customization Rules
        2. 7.4.1.2. Supplying Ribbon XML
        3. 7.4.1.3. VB.NET
        4. 7.4.1.4. C#
      2. 7.4.2. Ribbon Callbacks
        1. 7.4.2.1. C#
        2. 7.4.2.2. VSTO
    5. 7.5. Custom Task Panes
      1. 7.5.1. Creating Custom Task Panes
        1. 7.5.1.1. VB.NET
        2. 7.5.1.2. C#
      2. 7.5.2. Working with Custom Task Panes
    6. 7.6. Form Regions
      1. 7.6.1. Creating Custom Form Regions
        1. 7.6.1.1. VB.NET
        2. 7.6.1.2. C#
        3. 7.6.1.3. VSTO
      2. 7.6.2. Working with Custom Form Regions
        1. 7.6.2.1. VB.NET
        2. 7.6.2.2. C#
    7. 7.7. Custom Views
      1. 7.7.1. Types of Custom Views
      2. 7.7.2. Creating Custom Views
      3. 7.7.3. Filtering and Formatting Custom Views
      4. 7.7.4. View XML
    8. 7.8. Summary
  13. 8. Interfacing Outlook with Other Applications
    1. 8.1. Microsoft Word
    2. 8.2. Microsoft Excel
    3. 8.3. Microsoft Access
      1. 8.3.1. ADO
      2. 8.3.2. Access DAO
      3. 8.3.3. DAO DBEngine
    4. 8.4. Web Browser
      1. 8.4.1. Browser Control Form
    5. 8.5. Summary
  14. 9. Real-World Outlook Programming
    1. 9.1. Supporting Multiple Versions of Outlook
      1. 9.1.1. Coding for Compatibility
      2. 9.1.2. Ribbon Considerations and Workarounds
    2. 9.2. Addin Deployment
      1. 9.2.1. Unmanaged Code Addins
      2. 9.2.2. Managed Code Addins
        1. 9.2.2.1. VSTO 2005 SE Addins
        2. 9.2.2.2. Shared Managed Code Addins
    3. 9.3. Outlook Programming Limitations
      1. 9.3.1. Outlook 2007
      2. 9.3.2. Outlook 2003 and Earlier
    4. 9.4. Things We Still Don't Have in Outlook 2007
    5. 9.5. Using Alternate APIs
      1. 9.5.1. CDO
      2. 9.5.2. Redemption
    6. 9.6. Summary
  15. 10. Task Management System
    1. 10.1. Task Management System Features
    2. 10.2. The Connect Class
      1. 10.2.1. The VB Connect Class
      2. 10.2.2. The C# Connect Class
      3. 10.2.3. C# MyAxHost
      4. 10.2.4. VB Globals
      5. 10.2.5. VB OutExpl
      6. 10.2.6. C# OutExpl
      7. 10.2.7. VB ExplWrap
      8. 10.2.8. C# ExplWrap
      9. 10.2.9. VB OutInsp
      10. 10.2.10. C# OutInsp
      11. 10.2.11. VB InspWrap
      12. 10.2.12. C# InspWrap
      13. 10.2.13. VB TaskPane
      14. 10.2.14. C# TaskPane
    3. 10.3. VB Ribbon XML
    4. 10.4. C# Ribbon XML
    5. 10.5. Summary
  16. A. Outlook 2007 Object Model Summary
    1. A.1. New Objects and Collections
    2. A.2. New Properties and Methods
    3. A.3. Common DASL Property Tags
      1. A.3.1. Messages
      2. A.3.2. Appointments
      3. A.3.3. Contacts
      4. A.3.4. Tasks
  17. B. Troubleshooting Problems and Support
    1. B.1. Resources
      1. B.1.1. Microsoft
        1. B.1.1.1. Outlook and Office Developer Centers
        2. B.1.1.2. Blogs and Video Presentations
        3. B.1.1.3. Downloads
      2. B.1.2. Non-Microsoft Web Sites
      3. B.1.3. Tools
        1. B.1.3.1. MAPI Viewing Tools
        2. B.1.3.2. Software Development Kits
        3. B.1.3.3. Virtual Machines
    2. B.2. Support
      1. B.2.1. Newsgroups
      2. B.2.2. Forums
      3. B.2.3. MAPI Mailing List
      4. B.2.4. Support Catalogs
      5. B.2.5. Self-Help