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 ...
Get Excel® VBA: 24-Hour Trainer now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.