Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Create a Send/Receive macro in Outlook 2010

Posted on 2011-09-23
3
Medium Priority
?
982 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
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: …

721 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