Microsoft Outlook is the most widely used e-mail program and offers the most programmability. Sue Mosher introduces key concepts for programming Outlook using Visual Basic for Applications, custom Outlook forms, and external scripts, without the need for additional development tools.
For those who manage Outlook installations, it demonstrates how to use new features in the Outlook 2007 programming model such as building scripts that can create rules and views and manage categories. Power users will discover how to enhance Outlook with custom features, such as the ability to process incoming mail and extract key information. Aimed at the non-professional programmer, it also provides a quick guide to Outlook programming basics for pro developers who want to dive into Outlook integration.
- Dozens of new programming objects detailed including views, rules, categories, searches
- No previous coding experience or additional development tools required
- Examples outline issues using real-world functionality
Inhaltsverzeichnis
1;Cover Page;1 2;Microsoft Outlook 2007 Programming;2 3;Copyright Page;5 4;Contents;6 5;Introduction;12 6;Acknowledgments;14 7;Chapter 1 What You Can Do with Outlook 2007;16 7.1;1.1 Why program with Outlook?;17 7.2;1.2 Outlook programming tools;17 7.3;1.3 How to start;24 7.4;1.4 Key Outlook programming components;26 7.5;1.5 Showing developer commands;26 7.6;1.6 Summary;28 8;Part I Basic Outlook VBA Design;16 8.1;Chapter 2 The VBA Design Environment;30 8.1.1;2.1 VBA: The basics;30 8.1.2;2.2 VBA windows;33 8.1.3;2.3 Getting help in VBA;39 8.1.4;2.4 Working with VBA projects;41 8.1.5;2.5 Summary;44 8.2;Chapter 3 Building Your First VBA Form;46 8.2.1;3.1 Understanding Outlook birthdays and anniversaries;46 8.2.2;3.2 Step 1: What controls do you need?;47 8.2.3;3.3 Step 2: Create the form;48 8.2.4;3.4 Step 3: Add user input controls;51 8.2.5;3.5 Step 4: Add command buttons;53 8.2.6;3.6 Step 5: Plan the next development stage;60 8.2.7;3.7 More on VBA form controls;60 8.2.8;3.8 Summary;70 9;Part II Basic Outlook Form Design;72 9.1;Chapter 4 Introducing Outlook Forms;72 9.1.1;4.1 Understanding the two types of custom forms;72 9.1.2;4.2 Starting the forms designer;74 9.1.3;4.3 The six standard Outlook forms;75 9.1.4;4.4 When to use which form;89 9.1.5;4.5 Working in the forms designer;91 9.1.6;4.6 Saving forms and ending a design session;93 9.1.7;4.7 Creating your first custom contact form;96 9.1.8;4.8 Summary;109 9.2;Chapter 5 Introducing Form Regions;110 9.2.1;5.1 Understanding form regions;110 9.2.2;5.2 Controls for form regions;112 9.2.3;5.3 Creating your first form region;115 9.2.4;5.4 Registering and deploying form regions;118 9.2.5;5.5 Limitations of form regions;125 9.2.6;5.6 Other ideas for form regions;125 9.2.7;5.7 Summary;126 9.3;Chapter 6 Extending Form Design with Fields and Controls;128 9.3.1;6.1 Understanding fields versus controls;128 9.3.2;6.2 Creating user-defined fields;129 9.3.3;6.3 Adding and removing fields on Outlook forms;137 9.3.4;6.4 Using form cont
rols;143 9.3.5;6.5 Laying out compose and read pages;152 9.3.6;6.6 Summary;154 10;Part III Writing VBA and VBScript Code;156 10.1;Chapter 7 Outlook Code Basics;156 10.1.1;7.1 Understanding when VBA code runs;156 10.1.2;7.2 Writing VBA code;167 10.1.3;7.3 Writing VBScript code for Outlook forms;174 10.1.4;7.4 Referring to Outlook item properties;183 10.1.5;7.5 Writing other Outlook automation code;186 10.1.6;7.6 Summary;190 10.2;Chapter 8 Code Grammar 101;192 10.2.1;8.1 Option Explicit;192 10.2.2;8.2 Declaring variables and constants;194 10.2.3;8.3 Writing procedures;203 10.2.4;8.4 Working with expressions and functions;213 10.2.5;8.5 Working with strings;215 10.2.6;8.6 Working with dates and times;221 10.2.7;8.7 Using arrays, dictionaries, and the Split() and Join() functions;231 10.2.8;8.8 Controlling program flow;237 10.2.9;8.9 Providing feedback;249 10.2.10;8.10 Getting user input;255 10.2.11;8.11 Working with files and other objects;264 10.2.12;8.12 Summary;273 10.3;Chapter 9 Handling Errors, Testing, and Debugging;276 10.3.1;9.1 Understanding errors;276 10.3.2;9.2 Testing and debugging in VBA;284 10.3.3;9.3 Debugging Outlook form VBScript code;292 10.3.4;9.4 Summary;302 11;Part IV Fundamental Outlook Coding Techniques;304 11.1;Chapter 10 Outlook Programming Basics;304 11.1.1;10.1 Introducing the Outlook object model;304 11.1.2;10.2 Outlook object and collection code techniques;310 11.1.3;10.3 Understanding Outlook security;317 11.1.4;10.4 Summary;327 11.2;Chapter 11 Responding to Outlook Events in VBA;328 11.2.1;11.1 Application object events;329 11.2.2;11.2 Writing handlers for other object events;345 11.2.3;11.3 Explorers and Explorer events;348 11.2.4;11.4 Inspectors and Inspector events;353 11.2.5;11.5 Folders, Folder, and Items events;358 11.2.6;11.6 Processing incoming mail;362 11.2.7;11.7 Using the Application.Reminder and Reminders events;371 11.2.8;11.8 Summary;384 11.3;Chapter 12 Coding Key Custom Form Scenarios;386 11.3.1;12.1 Working with Outlook it
em events;386 11.3.2;12.2 Responding to user input on forms;392 11.3.3;12.3 Handling form and control state issues;406 11.3.4;12.4 Summary;415 11.4;Chapter 13 Working with Stores, Explorers, and Folders;416 11.4.1;13.1 Information store concepts;416 11.4.2;13.2 Information store techniques;418 11.4.3;13.3 Working with Explorers;425 11.4.4;13.4 Accessing folders;427 11.4.5;13.5 Working with folders;449 11.4.6;13.6 Summary;457 11.5;Chapter 14 Using PropertyAccessor and StorageItem;460 11.5.1;14.1 Using the PropertyAccessor object;461 11.5.2;14.2 Using the StorageItem object;473 11.5.3;14.3 Summary;477 11.6;Chapter 15 Working with Inspectors and Items;478 11.6.1;15.1 Working with Inspectors;479 11.6.2;15.2 Creating items;482 11.6.3;15.3 Accessing items;489 11.6.4;15.4 Using the Table object;499 11.6.5;15.5 Using Item methods;507 11.6.6;15.6 Summary;515 11.7;Chapter 16 Searching for Outlook Items;516 11.7.1;16.1 Introduction to Outlook search methods;516 11.7.2;16.2 Building search strings;518 11.7.3;16.3 Using Items.Find and Items.Restrict;536 11.7.4;16.4 Using Table search techniques;540 11.7.5;16.5 Using Explorer.Search;542 11.7.6;16.6 Using Application.AdvancedSearch;545 11.7.7;16.7 Summary;556 11.8;Chapter 17 Working with Item Bodies;558 11.8.1;17.1 Basic item body techniques;558 11.8.2;17.2 Parsing text from a message body;560 11.8.3;17.3 Adding text to an item;562 11.8.4;17.4 Creating a formatted message;566 11.8.5;17.5 Using WordEditor;569 11.8.6;17.6 Working with Outlook signatures;578 11.8.7;17.7 Summary;583 11.9;Chapter 18 Working with Recipients and Address Lists;584 11.9.1;18.1 Key recipient and address list objects;585 11.9.2;18.2 Understanding address lists;586 11.9.3;18.3 Working with item recipients;592 11.9.4;18.4 Reading Recipient and AddressEntry information;599 11.9.5;18.5 Reading free/busy information;603 11.9.6;18.6 Showing the Select Names dialog;609 11.9.7;18.7 Summary;616 11.10;Chapter 19 Working with Attachments;618 11.10.1;19.1 Understanding
Outlook attachments;618 11.10.2;19.2 Adding attachments to Outlook items;621 11.10.3;19.3 Working with attachments on existing items;623 11.10.4;19.4 Summary;633 11.11;Chapter 20 Common Item Techniques;634 11.11.1;20.1 Using custom message forms;635 11.11.2;20.2 Working with voting buttons and other custom actions;641 11.11.3;20.3 Sending a message with a specific account;652 11.11.4;20.4 Creating a meeting request;654 11.11.5;20.5 Assigning a task;656 11.11.6;20.6 Linking Outlook items;657 11.11.7;20.7 Creating an annual event from a custom date field;664 11.11.8;20.8 Summary;673 12;Part V Finishing Touches;674 12.1;Chapter 21 Deploying and Managing Outlook Forms;674 12.1.1;21.1 Understanding Outlook forms architecture;675 12.1.2;21.2 Managing Outlook forms;683 12.1.3;21.3 Managing custom fields;694 12.1.4;21.4 Deploying Outlook forms;698 12.1.5;21.5 Troubleshooting Outlook forms;705 12.1.6;21.6 Summary;708 12.2;Chapter 22 Rules, Views, and Administrator Scripting Tasks;710 12.2.1;22.1 Why Outlook scripting is a challenge;711 12.2.2;22.2 Internal scripting with custom message forms;712 12.2.3;22.3 Working with Outlook rules;721 12.2.4;22.4 Managing folder views;729 12.2.5;22.5 Internal scripting with folder home pages;743 12.2.6;22.6 Summary;750 12.3;Chapter 23 Menus, Toolbars, and the Navigation Pane;752 12.3.1;23.1 Programming Outlook menus and toolbars;752 12.3.2;23.2 Working with context menus;765 12.3.3;23.3 Working with the navigation pane and other Explorer panes;778 12.3.4;23.4 Summary;785 12.4;Chapter 24 Generating Reports on Outlook Data;786 12.4.1;24.1 Built-in report techniques;786 12.4.2;24.2 Coding reports with the Outlook object model;792 12.4.3;24.3 Sending output to Microsoft Excel;793 12.4.4;24.4 Sending output to Microsoft Word;803 12.4.5;24.5 Using Word to build an invoice report;807 12.4.6;24.6 Summary;823 13;Index;824