Chapter 29. Automating Common Tasks

Microsoft® Office Outlook® 2007 is a feature-rich product and, as such, has an option, a wizard, or a graphical tool for accomplishing nearly anything you require from a personal information manager. If something does come up that the folks at Microsoft haven’t planned for, however, you also have the option of customizing Office Outlook 2007 by using its built-in support for Microsoft Visual Basic® code additions. Through the use of flexible Visual Basic for Applications (VBA) scripting options and built-in security controls, you can easily simplify and automate common tasks.

In this chapter, you’ll learn how to create and use a macro. This includes creating the macro, stepping through a macro to test it, and deleting macros you no longer need. In addition, you’ll find out about implementing security options for macros.

Note

This chapter explores macros in general. For a more complete discussion of developing custom applications and automating tasks with Visual Basic, see Article 7, "Using VBA in Outlook," and Article 8, "Integrating Outlook and Other Applications with VBA," on the companion CD.

Understanding Automation Options

Outlook 2007 has a number of built-in automation options that allow the application to perform certain tasks for you. For example, the Rules Wizard automatically moves, copies, and forwards e-mail messages; and the Organize pane automatically color-codes e-mail messages and deals with junk and adult e-mail messages. The Out Of Office Assistant acts as an answering service when you’re away.

Note

For information about these examples of built-in automation options, see Chapter 11, and "Creating Automatic Responses with the Out Of Office Assistant" in Chapter 13.

If a built-in option can accomplish the automated task you require, it should be your first choice. By using a built-in option instead of a custom one, you minimize problems that can occur if you need to reinstall Outlook 2007 or use Outlook 2007 on multiple machines. Using standardized options also guards against compatibility problems with upgrades to Outlook 2007.

If none of the automation options does the trick, however, you can accomplish just about any customization by using VBA. This chapter focuses on the use of VBA procedures known as macros to automate common tasks.

Note

For detailed information about using VBA with Outlook 2007, see Article 7, "Using VBA in Outlook," and Article 8, "Integrating Outlook and Other Applications with VBA," on the companion CD.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset