How to run Outlook 2007/2010 Rules from a button

I was asked how a user could manually run all or a single rule, without having to use the outlook rules dialog box. here is how you do it.

First, go into the VB Editor,  Tools -> Macro’s > Visual Basic Editor (or press ALT-F11)

assuming you dont already have any modules in here.  Press Insert -> Module

you will be presented with a new window waiting for code, paste this in for all rules:


Sub RunAllInboxRules()
Dim st As Outlook.Store
Dim myRules As Outlook.Rules
Dim rl As Outlook.Rule
Dim count As Integer
Dim ruleList As String
‘On Error Resume Next’ get default store (where rules live)
Set st = Application.Session.DefaultStore
‘ get rules
Set myRules = st.GetRules

‘ iterate all the rules
For Each rl In myRules
‘ determine if it’s an Inbox rule
If rl.RuleType = olRuleReceive Then
‘ if so, run it
rl.Execute ShowProgress:=True
count = count + 1
ruleList = ruleList & vbCrLf & rl.Name
End If
Next

‘ tell the user what you did
ruleList = “These rules were executed against the Inbox: ” & vbCrLf & ruleList
MsgBox ruleList, vbInformation, “Macro: RunAllInboxRules”

Set rl = Nothing
Set st = Nothing
Set myRules = Nothing
End Sub

______________________________________________________________________________________________________________________________
and this for a single rule, dont forget to change rulename

___________________________________________________________________________________________________________________________________

Sub RunAllInboxRules()
Dim st As Outlook.Store
Dim myRules As Outlook.Rules
Dim rl As Outlook.Rule
Dim runrule As String
dim rulename as string

Rulename = “*****name of rule*****”

Set st = Application.Session.DefaultStore

Set myRules = st.GetRules

For Each rl In myRules

If rl.RuleType = olRuleReceive Then

If rl.Name = rulename Then
rl.Execute ShowProgress:=True
runrule = rl.Name

End If
End If
Next

ruleList = “This rule was executed against the Inbox:” & vbCrLf & runrule
MsgBox ruleList, vbInformation, “Macro: RunAllInboxRules”

Set rl = Nothing
Set st = Nothing
Set myRules = Nothing
End Sub

NB: if it doesnt work at first, as per this comment you may want to try replacing the “s with your own. It’s possible they are lost in translation.


VB Editor in MS Outlook 2007This will create a new macro that runs all the rules one by one in against your inbox.

Now create a button, goto View -> Tool bars -> Customize
go into the Toolbas Tab, and click New, call it what you want. I called mine “Rules”

The toolbar will be created floating, you can drag this now where you want it in the client. or leave it alone for now.
then go into the Commands Tab, scroll down to Macro’s on the left hand side, you should see Project1.Runallinboxrules in there. drag that up to the new toolbar and release it. This will make a new icon to the macro.

you can right click the icon to customise it. To bring it inline with the rest of the toolbars, I set mine to ‘Default Style’

Then you can close the Toolbar config window. and test it out. it will tell you which rules were run when it finishes

macro setup in outlook 2007

Note: This article uses code that was probably taken from this page http://www.outlookcode.com/codedetail.aspx?id=1266

 

  1. #1 by deyvsh on September 2, 2010 - 8:45 am

    Just what I was looking for, thanks!

  2. #2 by cg on September 22, 2010 - 6:11 pm

    the single rule name macro doesn’t work..

    the all rules macro does..

    really trying to find the single one for one specific rule

    • #3 by pyrocam on September 22, 2010 - 7:49 pm

      Hi There, this definately does work, if you are having issues you could try replacing the line
      If rl.Name = rulename Then
      with
      If rl.Name = “your rule name” Then

  3. #4 by Anthony on September 29, 2010 - 2:05 pm

    The single one didn’t work at first for me. Then I noticed the quotes were funny looking from the code I copied. Try deleting the quotes then replacing them by typing them in. They must have copied over incorrectly but changing them worked for me. Thanks for the code it works great!

    • #5 by pyrocam on September 29, 2010 - 7:09 pm

      Good call, the formatting is probably giving you curly quotation marks eg: ˮ instead of ". I will see what I can do to fix it. Cheers
      -edit:done, escaped all “‘s to "

  4. #6 by John on January 13, 2011 - 6:12 pm

    I am getting a debug on this line…

    Set myRules = st.GetRules

    Is there a particular reference that needs to be checked in the Tools | References… menu?

    • #7 by pyrocam on January 13, 2011 - 9:28 pm

      No references required.
      have you got some rules setup? what version of office are you using? what is the error message?

  5. #8 by John on January 14, 2011 - 12:26 am

    Windows 7, Outlook 2010

    Run-time error ‘-2147352567 (80020009)':
    This store does not support rules. Could not complete the operation.

    • #9 by pyrocam on January 14, 2011 - 1:43 am

      sounds like it cant logon to the store properly, are you running it from within outlook, or an external script?
      you could try starting outlook in safe mode (start , run, ‘outlook.exe /safe’ ) and running it, to see if its an addon thats causing the issue.

  6. #10 by spanijel on February 8, 2011 - 10:55 pm

    GREAT !!! this is exactly the shortcut that I was looking for.
    Thanks.
    How can I apply this macro to execute on a pst file (let’s say mySpecificeMails.pst) instead of inbox folder?

  7. #11 by Wayland Moncrief on February 18, 2011 - 6:51 pm

    I get compile errors when running the rules macro: user defined type not allowed. Are there files I need to include and how do I include them?

    • #12 by pyrocam on February 18, 2011 - 9:40 pm

      There are no files or references required, what line is highlighted when it gives the error?

  8. #13 by Nila on February 19, 2011 - 11:36 pm

    The all rules one worked for me after I changed the ‘ but it only runs rules from my Exchange account, not the account I am in or all accounts.

  9. #14 by Nila on February 22, 2011 - 6:06 pm

    To clarify, I’m connected to Exchange and 2 IMAP accounts. The run all rules script runs the exchange rules but not the IMAP account, regardless of which account folder I’m in. Using Win 7 Pro 64, Office 2010.

  10. #15 by Sumit on March 22, 2011 - 8:57 pm

    Awesomeeeeeeeeeeeee. thanks works like a charmmmmmmmm. Note type in the quotes cause when you copy paste the quotes change.

  11. #16 by Sumit on March 23, 2011 - 1:14 pm

    Ok got an issue. It just ran once and stopped working.

  12. #17 by Kevin on December 1, 2011 - 7:22 pm

    Very useful, thank you!

  13. #18 by Angel on December 2, 2011 - 6:45 pm

    Got the same error as John…
    Windows 7, Outlook 2010

    Run-time error ‘-2147352567 (80020009)’:
    This store does not support rules. Could not complete the operation.

    The debuger highlights the following line:
    Set myRules = st.GetRules

  14. #19 by Charlie on December 19, 2011 - 12:27 pm

    I also had the same problem as john. When I tried to run in safe mode no macros could be run.

  15. #20 by Richard on December 19, 2011 - 8:54 pm

    Same 0x80020009 error here on an IMAP setup – looks like the default store is “Personal Folders” which is the .pst Outlook created, instead of “Account@EmailProvider.com” which is the IMAP default store. I’ve not yet been able to get the macro to point to the IMAP store though :(

  16. #21 by Rob on December 29, 2011 - 12:06 pm

    Hi, Got a question trying to use your script to disable only one rule. But this isn;t working, I’m complete new to this, so hope you can help. Underneath is hat I tried. Thanks in advance.
    Rob
    ———-
    If rl.Name = rulename Then
    rl.Enabled = False

    ‘rl.Execute ShowProgress:=True
    ‘runrule = rl.Name

    End If

  17. #22 by David on January 19, 2012 - 7:11 pm

    Is it possible to designate more than one (but not all) rules with this method? I’m a non-coder, but i follow instructions REAL well.

  18. #23 by Michael on January 20, 2012 - 2:46 pm

    Any solution for the 0x90020009 error with an IMAP setup? Outlook 2010 can sync with a gmail account, but neither the All Rules or Single Rule macros will run. They both work fine when I use them on my work account since that uses Exchange Server.

  19. #24 by Elli on January 30, 2012 - 9:38 pm

    It’s working perfectly! However, I’d like to run this only on “Read” messages. Any ideas? Thank you!

  20. #25 by DJH on February 13, 2012 - 9:10 am

    The above macro template proved very helpful for Outlook 2007 rules management (my 385+ rules are manually run at least once daily) – thanks !!

    Note 1: Using trial-n-error (I’m a macros novice), I made minor revisions to add “Ready” and “Done” message boxes (see revised template below).

    Note 2: To enable this macro, the Outlook 2007 Macro Security Setting may need to be switched to the following option: Tools >> Macros >> Security >> “Warnings for all macros”.

    ==========

    Sub A_Run_All_Inbox_Rules()

    ‘ Macro Ready Message Box
    MsgBox “Ready: All Inbox Rules will be executed.”

    Dim st As Outlook.Store
    Dim myRules As Outlook.Rules
    Dim rl As Outlook.Rule
    Dim count As Integer
    Dim ruleList As String
    ‘On Error Resume Next

    ‘ get default store (where rules live)
    Set st = Application.Session.DefaultStore
    ‘ get rules
    Set myRules = st.GetRules

    ‘ iterate all the rules
    For Each rl In myRules
    ‘ determine if it’s an Inbox rule
    If rl.RuleType = olRuleReceive Then
    ‘ if so, run it
    rl.Execute ShowProgress:=True
    count = count + 1
    ruleList = ruleList & vbCrLf & rl.Name
    End If
    Next

    ‘ Macro Done Message Box
    MsgBox “Done: All Inbox Rules have been executed.”

    Set rl = Nothing
    Set st = Nothing
    Set myRules = Nothing
    End Sub

    ==========

  21. #26 by Norm on February 16, 2012 - 4:34 pm

    Worked like a charm. To the guy in the comment above me, you have your execution of the rule commented out! ‘ turns the line into a comment and it doesn’t execute ;)

  22. #27 by Christopher Adams on February 22, 2012 - 8:48 pm

    I put the e-mails I have answered into a DONE subfolder and then use my rules on the DONE folder.

    Is there any way this code can be adapted sot hat all of my rules in the Rules Wizard run on the subfolder and not the Inbox?

  23. #28 by D.J. Clark on March 26, 2012 - 2:26 pm

    Hello – I’d like to use this process to archive my sent e-mail items. I have a rule that does this, but when I create the VB routine and button as above, it does not archive the sent e-mails. I don’t get an error, but it doesn’t work. Is the routine above someone specific to to Inbox (as opposed to the Sent folder)? Thanks

  24. #29 by Danehbear on April 16, 2012 - 5:25 pm

    Thanks!

  25. #30 by Bill Hendricks on May 4, 2012 - 8:33 pm

    Ditto on #28’s question. Can this macro be modifed to run ALL rules rather than just INBOX rules? I tried modifying the inbox condition:

    ‘ iterate all the rules
    For Each rl In myRules
    ‘ determine if it’s an Inbox rule
    ‘If rl.RuleType = olRuleReceive Then
    ‘ if so, run it
    rl.Execute ShowProgress:=True
    count = count + 1
    ruleList = ruleList & vbCrLf & rl.Name
    ‘End If
    Next

    … but it still doesn’t work on SENT rules.

  26. #31 by Douglas Hahn on June 27, 2012 - 3:12 pm

    I found a solution to the Outlook 2010 error “This store does not support rules. Could not complete the operation”.

    Change
    Set st = Application.Session.DefaultStore
    To
    Set st = Application.Session.Stores(1)

    Seems to work for me. Here’s all my code:

    Sub RunAllInboxRules()
    Dim st As Outlook.Store
    Dim myRules As Outlook.Rules
    Dim rl As Outlook.Rule
    Dim count As Integer
    Dim ruleList As String
    ‘ On Error Resume Next

    ‘ get default store (where rules live)
    Set st = Application.Session.Stores(1)
    ‘ get rules
    Set myRules = st.GetRules
    ‘ iterate all the rules
    For Each rl In myRules
    ‘ determine if it’s an Inbox rule
    If rl.RuleType = olRuleReceive Then
    ‘ if so, run it
    rl.Execute ShowProgress:=True
    count = count + 1
    ruleList = ruleList & vbCrLf & rl.Name
    End If
    Next

    ‘ tell the user what you did
    ruleList = “These rules were executed against the Inbox: ” & vbCrLf & ruleList
    MsgBox ruleList, vbInformation, “Macro: RunAllInboxRules”

    Set rl = Nothing
    Set st = Nothing
    Set myRules = Nothing
    End Sub

  27. #32 by Ed on July 7, 2012 - 6:31 pm

    Outlook 2010

    I still seems to be receiving the following error:

    “This store does not support rules. Could not complete the operation”.

    With the following change in place:
    Set st = Application.Session.DefaultStore
    To
    Set st = Application.Session.Stores(1)

    Any suggestions?

  28. #33 by NeoGeo on August 9, 2012 - 6:58 pm

    I Have multiple in boxes and this run on the my personal one but not on the server I need to run them manually can someone show me how to modify the code or where to modify it to make it work on all inbox I have access to ?

    Thanks

  29. #34 by Ronto on August 14, 2012 - 5:36 pm

    BTW – Just tried the ‘RunAllRules’ module with Outlook 2013 Preview… seems to work well (a little slower than the native Run Rules Now (and selecting all) but does the job!

  30. #35 by Will on September 4, 2012 - 6:38 pm

    I use the Run All rules command frequently against my primary inbox, thank you.

    I want to evolve it a bit and need some help. I want to run 5 specific rules against a shared inbox, attaching it to a macro. How do i get the code to run it against a specific folder?

  31. #36 by Marcus on September 21, 2012 - 3:58 pm

    Worked great! Exactly what I needed. Thanks!

  32. #37 by Adrian W on September 24, 2012 - 8:05 am

    This can be modified to run rules on the current folder you have selected by adding the second line below (1st & 3rd line for context)

    Set myRules = st.GetRules
    Set cf = Application.ActiveExplorer.CurrentFolder
    For Each rl In myRules

    then add Folder:=cf
    as in:

    rl.Execute ShowProgress:=True, Folder:=cf

    This of course is very helpful to filter shared inboxes.

    • #38 by Ian Andrews on July 7, 2014 - 1:09 pm

      I found it was necessary to add the cf refinement to make this otherwise brilliant macro work.

    • #39 by Asusmin on August 13, 2014 - 6:41 pm

      Thanks, This works like a charm.

      But how can I run this only for the unread mails in the selected folder? That would make things faster ya?

      Cheers…!

  33. #40 by Diane R on October 4, 2012 - 8:09 pm

    LOVE IT!!! I made a few tweaks for what I needed but couldn’t have done it from scratch. Thanks so much for sharing.

  34. #41 by Scoot on November 28, 2012 - 9:36 am

    This is just what i’ve been looking for,m however, I can’t get it to work.

    When I click the button ( correctly assigned macro) it does absolutely nothing. No error message, nothing. I’m using Outlook 2010.

    In the macro itself, are the comment lines preceded by the ` next to the number 1 or the ‘ near the return key please?

    If I copy and paste the code above, I get red comment lines, if I replace the ` with a ‘ then I get green lines.

    Either way, I can’t get it to work anyway.

  35. #42 by pyrocam on December 5, 2012 - 10:34 pm

    Scoot :

    This is just what i’ve been looking for,m however, I can’t get it to work.

    When I click the button ( correctly assigned macro) it does absolutely nothing. No error message, nothing. I’m using Outlook 2010.

    In the macro itself, are the comment lines preceded by the ` next to the number 1 or the ‘ near the return key please?

    If I copy and paste the code above, I get red comment lines, if I replace the ` with a ‘ then I get green lines.

    Either way, I can’t get it to work anyway.

    replace the `’s so they go green, or just remove the line entirely
    don’t forget to replace all the speech-marks :)

  36. #43 by OShon on December 16, 2012 - 9:49 pm

    Thats my solution:

    Sub Uruchamianie_regul_outlooka()
    Dim r As Rule, a As Store, ns As NameSpace, f As Folder
    Set f = Application.ActiveExplorer.CurrentFolder
    Set ns = Application.Session
    For Each a In ns.Stores
    DoEvents
    On Error Resume Next
    For Each r In a.GetRules
    ‘Debug.Print r.Name
    If r.Name = “name_of_rule” Then _
    r.Execute ShowProgress:=True, Folder:=f
    Next
    Next a
    Set ns = Nothing
    Set f = Nothing
    End Sub

    regards: MVP OShon

  37. #44 by Bea on February 12, 2013 - 3:39 pm

    Thanks! Made my mail administration so much easier. Funny that such toolbar shortcut is not default in Outlook.
    Anyone know the solution to connect shortcut keys to run this macro. Eg ctrl+1

  38. #45 by Rich Wacholz on February 19, 2013 - 7:27 pm

    Hi…
    Just found your site after looking for this very type of code. It runs flawlessly (no errors) and prints out each rule I have, however it does not actually execute the rules. Office 365 2013 Outlook. Any ideas? Thanks.
    …RW

  39. #46 by Rich Wacholz on February 21, 2013 - 3:09 am

    Rich Wacholz :
    Hi…
    Just found your site after looking for this very type of code. It runs flawlessly (no errors) and prints out each rule I have, however it does not actually execute the rules. Office 365 2013 Outlook. Any ideas? Thanks.
    …RW

    Never mind. I had the wrong Inbox selected when running the script. Works great! Thanks.

  40. #47 by Jim George on March 4, 2013 - 1:31 pm

    This is exactly what I’m looking to create, but it doesn’t seem to work. After going through your instructions, and running the rule, I get an error box:
    Microsoft Visual Basic
    Compile error:
    Syntax error
    OK or Help

    and the first line of the code “Sub RunAllInboxRules()” get’s highlighted in yellow.

    Any suggestions for fixing this?

  41. #48 by pyrocam on March 4, 2013 - 7:39 pm

    Jim George :

    This is exactly what I’m looking to create, but it doesn’t seem to work. After going through your instructions, and running the rule, I get an error box:
    Microsoft Visual Basic
    Compile error:
    Syntax error
    OK or Help

    and the first line of the code “Sub RunAllInboxRules()” get’s highlighted in yellow.

    Any suggestions for fixing this?

    Hi Jim, at a quess you need to replace the speechmarks. replace every ” you can find with your own “

  42. #49 by David Lachnicht on March 12, 2013 - 1:54 pm

    Can I select folder other than Inbox to run the rule against?

  43. #50 by pyrocam on March 18, 2013 - 7:43 pm

    David Lachnicht :

    Can I select folder other than Inbox to run the rule against?

    I believe there are instructions for this in the comments

    • #51 by Kyle Anderson on March 28, 2013 - 12:36 pm

      I see there are couple people asking this question, but no answer.

      • #52 by pyrocam on March 29, 2013 - 10:27 pm

        what about comment #37?

  44. #53 by Joey on March 19, 2013 - 5:54 pm

    Perfect, thanks. I had to replace the ‘ not the ” but then it ran great.

  45. #54 by Darkblaid on March 21, 2013 - 3:20 pm

    Hi Guys just trying to adapt this to work in outlook 2003 and i’m getting an error on Dim st As Outlook.Store stating User-defined type not defined and am stumped tbh

    Thanks in advance for any help

  46. #55 by Chesare on April 4, 2013 - 5:28 am

    Hi everybody!… I need to create a macro that backup all rules from outlook 2010 (client and server).
    Any thoughts on this? Please

  47. #56 by viperiv on May 31, 2013 - 12:43 pm

    Thank you very much for the script. You noted in your instructions that the single quote may translate incorrectly…..that’s what happened to me. It came across as ` and I changed it to ‘

    Works great and your detailed instructions were an exceptional example of good documentation. Again, many thanks.

  48. #57 by matt on July 11, 2013 - 4:00 pm

    Brilliant. I removed the two lines that open the dialog box at the end and still worked flawlessly.

  49. #58 by Kanban on August 27, 2013 - 4:02 am

    Fantastic piece of coding, all very exciting, opens new doors for me, thank you

  50. #59 by Mausum Sanfui on September 20, 2013 - 9:21 pm

    how can i schedule this macro to run on specific time to run

  51. #60 by Alex on October 18, 2013 - 1:14 pm

    Hi
    Thanks very much for this, really useful. Would anyone know how to modify the code to EXCLUDE one or two rules, but run all the others?
    Thanks!

  52. #61 by Bernard Wortelboer on November 27, 2013 - 12:18 pm

    Outlook 2010, with multiple IMAP accounts.

    I received the following error: “This store does not support rules. Could not complete the operation”.

    With the following change in place:
    Set st = Application.Session.DefaultStore
    To
    Set st = Application.Session.Stores(1)

    it didn’t work. So I tried something new: a different number for the store:

    Set st = Application.Session.Stores(2)… didnot work for me

    Set st = Application.Session.Stores(3).

    That worked for my default IMAP account. It is now running smooth !

  53. #62 by Ben on November 28, 2013 - 5:28 pm

    Hi,
    Is there a way to specify which set of rules per mailbox? I have 2 mailboxes, with different sets of rules and I only want to run the one mailboxes worth. Outlook 2013.
    Thanks
    Ben

  54. #63 by Bob on February 14, 2014 - 3:33 pm

    Looks like this post was copied directly from an outlookcode article posted 31-MAY-2006. A link or mention of the original article would be a good idea.

    • #64 by pyrocam on February 14, 2014 - 7:33 pm

      Thanks Bob, yes I am using the code that was not written by me, but the post is mine. I have updated the article to reflect where the code probably came from, as I cant recall where I got this specific code from. You will note it shows up frequently all over the internet

  55. #65 by Brandon on March 21, 2014 - 6:41 pm

    How can this be modified to run a single rule on all of the folders (and their subfolders) within the inbox?

  56. #66 by Brandon on March 21, 2014 - 6:49 pm

    Basically, I need to run the single rule with the “Include Subfolders” option checked. See this image:

    h**p://s10.postimg.org/73wa3w5m1/Include_Subfolders.png

  57. #67 by Brandon on March 21, 2014 - 9:08 pm

    Sorry about the link btw. I figured that rule was just to prevent advertising, so I put *’s in it so I could show you the picture.

  58. #68 by Rahul on April 4, 2014 - 1:52 pm

    Thanks a lot man !!!!!!!!!!!!!!!!!!!!!
    i was just looking for it…worked like a charm !

    just had to replace & retype single and double quotes again as macro was not working fine when i copied the code.

    if facing compile issue,….just remove and retype all the single and double quotes

    Thanks

  59. #69 by Jeff Adair on April 10, 2014 - 4:33 pm

    i copied the code and had to do some tweaks like replace the ` with ‘ so everything looks the same now as in the picture , fyi when you copy the code from this page i had to tab the sentences so they line up just like in the picture. i am not big code guy so im learning. my problem now is with this piece of it:
    Sub RunAllInboxRules() when i hit the run button or select compile i get a Compile error : sub or function not defined. i currently have a bunch of rules setup for 1 inbox that is connected to Exchange. I am using Outlook office 2007. here is what i have under module:
    Sub RunAllInboxRules()
    Dim st As Outlook.Store
    Dim myRules As Outlook.Rules
    Dim rl As Outlook.Rule
    Dim count As Integer
    Dim ruleList As String
    ‘On Error Resume Next

    ‘ get default store (where rules live)
    Set st = Application.Session.DefaultStore
    ‘ get rules
    Set myRules = st.GetRules

    ‘ iterate all the rules
    For Each rl In myRules
    ‘ determine if it’s an Inbox rule
    If rl.RuleType = olRuleReceive Then
    ‘ if so, run it
    rl.Execute ShowProgress:=True
    count = count + 1
    ruleList = ruleList & vbCrLf & rl.Name
    End If
    Next

    ‘ tell the user what you did
    ruleList = “These rules were executed against the Inbox: ” & vbCrLf & ruleList
    MsgBox ruleList, vbInformation, “Macro: RunAllInboxRules”

    Set rl = Nothing
    Set st = Nothing
    Set myRules = Nothing
    End Sub

    • #70 by pyrocam on April 11, 2014 - 3:37 am

      Sorry Jeff I am no longer actively supporting this. I can’t see anything wrong with your code. Although just to confirm, the lines that start with ‘ are green (these are comments you can delete them and you replaced every ” with a your own ” right?
      Is there any code outside of the sub …. end sub ? there shouldn’t be.

  60. #71 by Jeff Adair on April 10, 2014 - 8:11 pm

    hello i need some assistance with the above. Thank you!!

    • #72 by Jeff Adair on April 10, 2014 - 8:25 pm

      please forgive i didnt see the 24hour approval. thanks

  61. #73 by Jason on October 7, 2014 - 7:59 pm

    @#60
    Replace:
    If rl.Name = rulename Then
    rl.Execute ShowProgress:=True, Folder:=cf
    runrule = rl.Name
    End If

    With:

    If rl.Name = “excluded rule name” Then
    ‘Do nothing
    elseif rl.Name = “2nd excluded rule name” then
    ‘Do Nothing
    ‘You can continue adding them in this pattern
    ‘if you have more than two.
    else
    rl.Execute ShowProgress:=True, Folder:=cf
    runrule = rl.Name
    End If

Please read before posting
  • If you post any sort of link or URL in your comment it will automatically be deleted
  • All posts are moderated, I will approve your comment usually within 24 hours
  • It seems if you get the CAPTCHA wrong it deletes your post, if it looks dubious please copy your comment into the clipboard first so you don't have to re-write it. Or you can use the refresh button on the RECAPTCHA box
    • (will not be published)
      Protected by WP Anti Spam
       

Bad Behavior has blocked 702 access attempts in the last 7 days.