Applies to Microsoft Outlook 2013, Outlook 2010, Outlook 2007, Outlook 2003 and below
A visitor to our OutlookForums site wanted to know if he could create a button for an account:
Is it possible to create a toolbar button that would execute Send/Receive on one specific mail account only? I have send/receive groups, and the pull-down button for all accounts from the toolbar, but that involves some menu-wading.
While there are workable options for easier access that don't involve using VBA, you can use Outlook's SyncObjects property in a macro to trigger a send and receive for a specific Send/Receive Group or Account.
This sample does a send and receive on a specific send and receive group. To use, replace the 1 in mySyncObjects(1) with the desired group's position number.
Alternately, you could use the Group's name mySyncObjects("New Group")
Send and Receive Group macro
To use, open the VBA Editor using Alt+F11 and paste this code in either ThisOutlookSession or a Module. Assign it to a toolbar, ribbon, or QAT button to run it.
Public Sub SendReceiveGroup()
Dim mySyncObjects As Outlook.SyncObjects
Dim syc As Outlook.SyncObject
Set mySyncObjects = Application.GetNamespace("MAPI").SyncObjects
Set syc = mySyncObjects(1)
syc.Start
End Sub
More Information
OL2000: How to Programmatically Synchronize Folders (MSKB)
NameSpace.SyncObjects Property (TechNet)

