Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Create a Send/Receive macro in Outlook 2010

Posted on 2011-09-23
3
Medium Priority
?
988 Views
Last Modified: 2012-05-12
Hi folks,

I hope you can help.

I know how to assign a macro to a custom ribbon but what I don't know is the correct code/syntax to achieve the desired outcome when a custom button is executed!

I have a couple of Send and Receive Groups defined in Outlook 2010.  One of them will only work when I'm connected via VPN to the office and the other will only work when I'm NOT connected via VPN.  What I'd ideally like is to have a couple of custom buttons that executes either Send/Receive Group 1 or Group 2.  Can you offer me some sample vba macro code that would achieve this?

Many thanks in advance for any help you feel able to give.
0
Comment
Question by:BabyFaceLima
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 1600 total points
ID: 36590710
Hi, BabyFaceLima.

Here's the code for doing what you described.  Duplicate the code once, changing the name of the send receive group, for each button.
Sub SendReceiveGroup1()
    Dim olkSync As Outlook.SyncObject
    'Change the send/receive group name on the next line'
    Set olkSync = Session.SyncObjects("SomeSendReceiveGroupName")
    olkSync.Start
End Sub

Open in new window

0
 

Author Closing Comment

by:BabyFaceLima
ID: 36592065
Thanks you so much.  That's excellent!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 36592807
You're welcome.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question