Link to home
Start Free TrialLog in
Avatar of IT_Crowd
IT_CrowdFlag for Heard Island and McDonald Islands

asked on

Outlook Rule For A Certain Time Period

I would like to setup an Outlook (we're on 2010 right now) rule to forward emails if the following criteria is met.

Email is received between:
00:00 and 07:59
or
12:00 and 12:59
or
17:00 and 24:00

I tried the following link, but it looks like Outlook isn't honoring the 24 hour clock because Outlook was forwarding emails at 3:00 PM
http://dan.folkes.me/2011/02/18/outlook-rule-only-at-specific-times/

Any ideas?
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

the article states it uses UTC time which unless you are in England you have to compute the time difference i.e. Eastern Standard is UTC -5, so I have to ADD 5 hours to the rule to make it work
You can change the time zone under Options - Calendar -> scroll down to Time zones section.
Jon
Since the rule outlined in that article is a client-only rule (i.e. Outlook has to be running for the rule to work, why not simplify things and use a macro?  With a macro you won't have to edit it every year to adjust the date and it's a lot easier to spell out the times when you want to forward.  Something like this

Sub ForwardAtCertainTimes(Item As Outlook.MailItem)
    'On the next line, edit the address to forward to
    Const FWD_TO = "someone@company.com"
    Dim bolFwd As Boolean, olkFwd As Outlook.MailItem
    Select Case Time
        Case #12:00:00 AM# To #7:59:59 AM#, #12:00:00 PM# To #12:59:59 PM#, #5:00:00 PM# To #11:59:59 PM#
            bolFwd = True
    End Select
    If bolFwd Then
        Set olkFwd = Item.Forward
        olkFwd.To = FWD_TO
        olkFwd.Send
    End If
End Sub

Open in new window


To use this, add the code to Outlook (let me know if you need instructions for that), then create a rule that fires for all messages.  Set the rule's action to "run a script" and select this script as the one to run.
Avatar of IT_Crowd

ASKER

Thanks guys - I will check on these solutions and report back!
I'm hoping to make this a server sided rule because I'd like to apply this to an account that I wouldn't normally open with Outlook (our Helpdesk account). Most of the time, I just open up OWA and modify any Helpdesk related rules.

I was able to get success using the Central Time Zone values instead of UTC. For instance:
"2014 11:" for 11:00.

My new issue is trying to tell Outlook/OWA that this is a message coming in from the AM or PM. My first thought was to set an importance level if the subject contained AM or PM (High Importance for AM and Low Importance for PM) and use that importance flag in a rule below that for the time frames that I want.

That didn't appear to work, though. Maybe because the incoming message didn't have an importance flag set by the sender?  

Anyone have any other ideas for this - it doesn't have to be done with importance flags.
To clarify, all this rule will be doing is forwarding the original email off as an attachment to a select few. Nothing else.
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial