O'Reilly logo

Excel® VBA: 24-Hour Trainer by Tom Urtis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 28. Working with Outlook from Excel

Microsoft Outlook is the e-mail client application that is included in Microsoft's Office suite. In addition to e-mail management, Outlook also provides personal information management capabilities with its Calendar, Contacts, and Task Manager features. Each of these components in Outlook can be controlled from Excel with VBA.

Note

With all the competing e-mail clients to choose from, Outlook continues to be far and away the world's most popularly used e-mail application. Chances are pretty good that Outlook is your e-mail client at work or at home, or it is being used by the recipients of e-mails you send.

OPENING OUTLOOK

Before diving into the programming of Outlook from Excel, it's important to be aware of a particular design distinction of Outlook that is different than Excel, Word, Access, or PowerPoint. Unlike those other Office applications for which you can create multiple instances, Microsoft designed Outlook, when serving as a default e-mail client, to provide for only one instance to be open at a time.

Note

As with any application, ways exist to circumvent Outlook's resistance to multiple open instances, but why anyone would want to force that is beyond me. When it comes to handling e-mails, tasks, and calendars, it's just common sense to have only a single instance of Outlook open at any one time.

The following macro first checks to see if Outlook is already open, and if so, Outlook is activated. If Outlook happens to be closed, an ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required