Send/Receive Mail From All Accounts Using Outlook

Category:
Office/VBA
Type:
Snippets
Difficulty:
Intermediate
Author:
Tom Wikman

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
This function requires a reference to the Outlook Object Library and the Office Object Library. There are some unusual circumstances when it won't work (e.g., if the user has a mail message open but not outlook itself) so you should check the return value when using it, or try to see if you can modify it to deal with this scenario.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: