Run all Outlook rules as a scheduled task

Outlook is processing Junk mail rules before custom rules and several messages do not get moved to the inbox.  Would like to schedule Outlook rules to run as a task using a VB script that moves items from Junk folder to Inbox based on the rule I created.  Found a webpage that has a vbscript on this but not an experience scripter.  Anyone have a script that can do this?

Also, found this Expert script but nothing is moved when I run it.  Only get a dialog saying which rules were executed against the inbox.
http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/Q_24144857.html?sfQueryTermInfo=1+outlook+rule

Thanks
skinneeJAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dlancelotCommented:
skinneeJ, rules are executed in order they are created, you can re-order your rules to suit your needs thus avoiding having to mess around with the vbscript solution.  Could re-ordering your rules fix your issues?
0
skinneeJAuthor Commented:
dlancelot, in my case the rule is at the very top but Outlook will occastionally override my rule when the message arrives.  If I run the rule manually after the message is in Junk folder it gets moved to the inbox . I would expect it to work the same way when messages arrive, but this is not happening.

We also have other users who have this same problem with rules they've created and need some sort of workaround since we cannot turn off Outlooks Junk filter.
0
dlancelotCommented:
I have noticed this myself, what I have done is when creating or editing the rule, make sure on the second page of rule options, you check off the "stop processing more rules" option.  This fixed my issue
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

skinneeJAuthor Commented:
I tried checking the "stop processing more rules" option and msgs are still going to Junk folder.  Here's my rule:

Apply this rule after the message arrives
with 'New Ticket' or 'New Client Reply' or 'New Staff Reply' in the subject
move it to the Inbox folder
  and stop processing more rules
0
dlancelotCommented:
Is the email controlled by the exchange server?  I'm wondering if it's not outlook marking it as junk...
0
skinneeJAuthor Commented:
Outlook is marking it as junk.
0
David LeeCommented:
Hi, skinneej.

Sorry, but I'm a little confused.  How will running all the rules via a scheduled task fix the problem of the junk mail filter putting items in junk mail that don't belong there?
0
skinneeJAuthor Commented:
Because Outlook is processing the Junk mail rules before applying my custom rules.  If I go into Rules and Alerts and Run Rules Now the messages will be moved to the inbox.
0
David LeeCommented:
So when you run the rules manually you are selecting the option to run them against a folder other than the inbox.  Correct?  If not, then I'm not understanding how you're getting the items out of the junk items folder.
0
skinneeJAuthor Commented:
BlueDevilFan, Yes I'm running the rules manually against the Junk folder.
0
David LeeCommented:
Got it.  Is that the folder you want to run them against if you can run rules via a scheduled task?
0
skinneeJAuthor Commented:
Yes it is.
0
David LeeCommented:
Ok, this should do it.  Here's the code.  Follow these instructions to use it.

1.  Open Notepad
2.  Copy the code below and paste it into Notepad
3.  Edit the script per the comments I included in it
4.  Save the file with a .vbs extension
5.  Test the script by double-clicking on the vbs file
6.  Create a scheduled task for running the script.  Note that you must be logged in with Outlook open and running for the script to work.  If Outlook is not running, then the script won't do anything.
'Change the following three constants as desired
Const SHOW_PROGRESS = True
Const INCLUDE_SUBFOLDERS = False
Const UNREAD_MSGS_ONLY = 2
Const olFolderJunk = 23

Dim olkApp, olkFld, olkRul
On Error Resume Next
Set olkApp = GetObject(,"Outlook.Application")
If TypeName(OlkApp) = "Application" Then
    Set olkFld = olkApp.Session.GetDefaultFolder(olFolderJunk)
    For Each olkRul In olkApp.Session.DefaultStore.GetRules
        olkRul.Execute SHOW_PROGRESS, olkFld, INCLUDE_SUBFOLDERS, UNREAD_MSGS_ONLY
    Next
End If
Set olkRul = Nothing
Set olkFld = Nothing
Set olkApp = Nothing

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
skinneeJAuthor Commented:
This is exactly what I was looking for.
0
David LeeCommented:
Cool.  Glad I could help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.