Microsoft Outlook Programming unleashes the power of Microsoft Outlook, allowing administrators and end users to customize Outlook in the same way that they've used macros and templates to customize other programs like Excel and Word. Experienced developers will find the quick-start information they need to begin integrating Outlook into their applications. Microsoft Exchange administrators will get help automating common tasks such as announcing public folders and importing data to custom forms. Microsoft Outlook is the most widely used email program, and it offers the most programmability. This book introduces key concepts for programming both Outlook forms for storing and exchanging data and Visual Basic for Applications modules that add new features to Outlook. Central to this new edition, which covers both Outlook 2000 and Outlook 2002, is awareness of tighter security in Outlook. Designed to prevent transmission of computer viruses, the security restrictions can also get in the way of legitimate programs, but this book offers workarounds within the reach of novice programmers. It also covers many of the new features of Outlook 2002, such as the integrated Outlook View Control and searching across multiple folders using SQL syntax and the Search object. ·Building block procedures for the most common Outlook programming tasks·Jargon-free language and practical examples to make the material more accessible to new Outlook programmers·Coverage of Outlook Email Security Update·Coverage of the Office XP Web Services Toolkit
Inhaltsverzeichnis
1;Front Cover;1 2;Microsoft Outlook Programming;4 3;Copyright Page;5 4;Contents;6 5;Foreword;12 6;Acknowledgments;16 7;Introduction;18 8;Chapter 1. What You Can Do with Outlook;20 8.1;1.1 Why program with Outlook?;20 8.2;1.2 Outlook programming tools;21 8.3;1.3 New programming features in Outlook 2002;27 8.4;1.4 How to start;28 8.5;1.5 A word on Outlook versions and setup;30 8.6;1.6 Summary;31 9;Part I: Outlook VBA Design;32 9.1;Chapter 2. The VBA Design Environment;34 9.1.1;2.1 VBA security;34 9.1.2;2.2 Starting VBA;35 9.1.3;2.3 Saving your work and ending a VBA session;36 9.1.4;2.4 VBA windows;37 9.1.5;2.5 Working with VBA projects;44 9.1.6;2.6 Getting help in VBA;45 9.1.7;2.7 Summary;47 9.2;Chapter 3. A VBA Birthday/Anniversary Reminder Form;48 9.2.1;3.1 Understanding Outlook birthdays and anniversaries;48 9.2.2;3.2 Step 1: What controls do you need?;49 9.2.3;3.3 Step 2: Create the form;50 9.2.4;3.4 Step 3: Add user input controls;54 9.2.5;3.5 Step 4: Add command buttons;56 9.2.6;3.6 Step 5: Plan the next development stage;63 9.2.7;3.7 More on VBA form controls;64 9.2.8;3.8 Summary;74 10;Part II: Adding VBA Code;76 10.1;Chapter 4. Code Basics;78 10.1.1;4.1 Understanding when code runs;78 10.1.2;4.2 Writing VBA code;88 10.1.3;4.3 Summary;94 10.2;Chapter 5. Code Grammar 101;96 10.2.1;5.1 Option Explicit;96 10.2.2;5.2 Declaring variables;98 10.2.3;5.3 Understanding scope;101 10.2.4;5.4 Declaring constants;103 10.2.5;5.5 Coding style;106 10.2.6;5.6 Summary;111 10.3;Chapter 6. Working with Expressions and Functions;112 10.3.1;6.1 Elements of an expression;112 10.3.2;6.2 Using mathematical expressions;114 10.3.3;6.3 Working with strings;115 10.3.4;6.4 Working with dates;119 10.3.5;6.5 Using user-created functions;125 10.3.6;6.6 Using Split( ) and Join( ) functions, and arrays;127 10.3.7;6.7 Summary;130 10.4;Chapter 7. Controlling Program Flow;132 10.4.1;7.1 if ... Then statements;132 10.4.2;7.2 Select Case statements;136 10.4.3;7.3 Do loops;138 10.4.4;7.4 For ... Next
loops;140 10.4.5;7.5 GoTo statements;144 10.4.6;7.6 Summary;145 10.5;Chapter 8. Handling Errors and Debugging VBA Applications;146 10.5.1;8.1 Understanding errors;146 10.5.2;8.2 Debugging in VBA;152 10.5.3;8.3 Creating clean applications;157 10.5.4;8.4 Summary;163 10.6;Chapter 9. Handling User Input and Feedback;164 10.6.1;9.1 Getting user input;164 10.6.2;9.2 Providing feedback;175 10.6.3;9.3 Summary;180 11;Part III: Special Outlook Techniques;182 11.1;Chapter 10. Working with the Object Models;184 11.1.1;10.1 Using the VBA Object Browser;185 11.1.2;10.2 Object and collection code techniques;190 11.1.3;10.3 Programming with Collaboration Data Objects;196 11.1.4;10.4 Using the Scripting Runtime Library;201 11.1.5;10.5 More useful object model techniques;206 11.1.6;10.6 Summary;209 11.2;Chapter 11. Responding to Outlook Events in VBA;210 11.2.1;11.1 Application object events;210 11.2.2;11.2 Writing handlers for other object events;218 11.2.3;11.3 Explorer events;219 11.2.4;11.4 Inspector events;223 11.2.5;11.5 Folders and Items events;225 11.2.6;11.6 Reminders events;232 11.2.7;11.7 Other events;235 11.2.8;11.8 Summary;236 11.3;Chapter 12. Working with Stores and Folders;238 11.3.1;12.1 Information store concepts;238 11.3.2;12.2 Information store techniques;239 11.3.3;12.3 Working with Explorers;242 11.3.4;12.4 Accessing folders;244 11.3.5;12.5 Folder techniques;252 11.3.6;12.6 Summary;258 11.4;Chapter 13. Understanding Outlook Security;260 11.4.1;13.1 Attachment security;261 11.4.2;13.2 Automation security;262 11.4.3;13.3 Outlook form code security;263 11.4.4;13.4 Customizing Outlook security;263 11.4.5;13.5 Coping with the security features;264 11.4.6;13.6 Using the Redemption Library;267 11.4.7;13.7 Summary;276 11.5;Chapter 14. Working with Items and Recipients;278 11.5.1;14.1 Working with Inspectors;278 11.5.2;14.2 Creating items;280 11.5.3;14.3 Accessing items;283 11.5.4;14.4 Using item methods;299 11.5.5;14.5 Working with the item Body property;302 11.5.6;14.6
Working with recipients;305 11.5.7;14.7 Summary;317 12;Part IV: Outlook Form Design;320 12.1;Chapter 15. Outlooks Six Basic Forms;322 12.1.1;15.1 Starting the forms designer;322 12.1.2;15.2 The basic Outlook forms;323 12.1.3;15.3 When to use which form;336 12.1.4;15.4 Working in the forms designer;337 12.1.5;15.5 Getting help in Outlook forms design;339 12.1.6;15.6 Saving forms and ending a design session;340 12.1.7;15.7 Summary;343 12.2;Chapter 16. Creating Your First Custom Contact Form;344 12.2.1;16.1 The process in a nutshell;344 12.2.2;16.2 Add and modify controls and pages;345 12.2.3;16.3 Complete the form;356 12.2.4;16.4 Summary;360 12.3;Chapter 17. Extending Form Design with Fields and Controls;362 12.3.1;17.1 Understanding fields versus controls;362 12.3.2;17.2 Creating user-defined fields;363 12.3.3;17.3 Adding fields to Outlook forms;370 12.3.4;17.4 Laying out compose and read pages;376 12.3.5;17.5 Summary;378 12.4;Chapter 18. Writing Code to Respond to Outlook Form Events;380 12.4.1;18.1 Outlook form code basics;380 12.4.2;18.2 Converting VBA code to VBScript;388 12.4.3;18.3 Understanding event order;396 12.4.4;18.4 Reacting to control and property changes;400 12.4.5;18.5 Debugging in VBScript;407 12.4.6;18.6 Summary;411 12.5;Chapter 19. More Controls for Outlook Forms;412 12.5.1;19.1 Using the basic controls;412 12.5.2;19.2 Using more controls from the Toolbox;419 12.5.3;19.3 Adding more ActiveX controls;423 12.5.4;19.4 Summary;430 12.6;Chapter 20. Common Outlook Form and Item Techniques;432 12.6.1;20.1 Working with form layouts;432 12.6.2;20.2 Understanding Outlook forms architecture;436 12.6.3;20.3 Linking Outlook items;440 12.6.4;20.4 Working with custom actions;451 12.6.5;20.5 Using forms over the Internet;462 12.6.6;20.6 Summary;469 13;Part V: Finishing Touches;470 13.1;Chapter 21. Menus, Toolbars, and the Outlook Bar;472 13.1.1;21.1 Programming Outlook menus and toolbars;472 13.1.2;21.2 Programming the Outlook Bar;493 13.1.3;21.3 Summary;497 13.2;
Chapter 22. Designing Outlook Reports;500 13.2.1;22.1 Built-in report techniques;501 13.2.2;22.2 Sending output to Microsoft Excel;507 13.2.3;22.3 Sending output to Microsoft Word;514 13.2.4;22.4 Summary;534 13.3;Chapter 23. Exchange Server, Databases, and XML Web Services;536 13.3.1;23.1 Managing Exchange public folders;536 13.3.2;23.2 Working with databases;553 13.3.3;23.3 Using XML Web services (Outlook 2002);565 13.3.4;23.4 Summary;575 13.4;Chapter 24. Deploying Forms and Applications;576 13.4.1;24.1 Deploying forms;576 13.4.2;24.2 Managing forms;588 13.4.3;24.3 Distributing VBA applications;591 13.4.4;24.4 Summary;595 14;Appendix A: Resources for Outlook Programming;596 15;Appendix B: Files Blocked by Outlook Security;604 16;Appendix C: Key Procedures You Can Reuse;608 17;Index;612