+ Reply to Thread
Results 1 to 5 of 5

Run macro each time Outlook checks the server for mail

  1. #1
    Registered User
    Join Date
    01-21-2010
    Location
    Oregon
    MS-Off Ver
    Excel 2003
    Posts
    3

    Run macro each time Outlook checks the server for mail

    The macro that I want to run has nothing to do with Outlook, but I thought that Outlook might be a good way to force this macro to run repeatedly on a schedule all day long.
    Outlook is set to check the server for new mail every three minutes, so this macro would run every three minutes whether new mail was detected or not.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Can I run a macro each time Outlook checks the server for mail?

    Have a look here for how to schedule a macro repeatedly after a set time:

    http://www.cpearson.com/excel/OnTime.aspx

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    01-21-2010
    Location
    Oregon
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Can I run a macro each time Outlook checks the server for mail?

    That works in Excel. The Outlook "Application" does not support the "ontime" )object. At least not in my Outlook (2007).

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Run macro each time Outlook checks the server for mail

    Quote Originally Posted by rio View Post
    The macro that I want to run has nothing to do with Outlook,
    I didn't think it was Outlook that you were trying to automate.

    Dom

  5. #5
    Registered User
    Join Date
    11-09-2008
    Location
    germany
    Posts
    74

    Re: Run macro each time Outlook checks the server for mail

    Quote Originally Posted by rio View Post
    The macro that I want to run has nothing to do with Outlook, but I thought that Outlook might be a good way to force this macro to run repeatedly on a schedule all day long.
    Outlook is set to check the server for new mail every three minutes, so this macro would run every three minutes whether new mail was detected or not.
    The event you are looking for is this one here http://msdn.microsoft.com/en-us/libr...ice.11%29.aspx
    This is going to fire in Outlook for you.

    If you are using this from Excel you will need to get the outlook object and then use WITHEVENTS so that this event will fire in your excel.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1