I found the following macro on the net:
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
' Execute just these rules
If rl.Name = "DOR" Then
count = count + 1
ruleList = ruleList & vbCrLf & rl.Name
' 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
When I run the macro I get: Runtime-error '-451673599 (e5140201)': Automation error.
When I click debug, 'Next' is highlighted in yellow.
I also assume the rule does not work in this macro. rl.Execute ShowProgress:=True runs for a second, but does not do the nessesary actions...
can someone help me with this?