Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: macro button setup to run Rulesets on the fly

10 Apr 2014   #1

Windows 7, linux
macro button setup to run Rulesets on the fly

having some issues running this vb script. I want to have a macro button to run on the fly my rules in Outlook 2007 instead of always clicking and checking them manually. I found this script but to no avail doesnt work even after i cleaned it up. im stuck on this part of it: Sub RunAllInboxRules() it says compile error sub or function not defined.

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
‘ 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

My System SpecsSystem Spec


 macro button setup to run Rulesets on the fly

Thread Tools

Similar help and support threads for2: macro button setup to run Rulesets on the fly
Thread Forum
Taskbar Button: Change Color of Orange Flashing Button Tutorials
What is Macro / Script ? General Discussion
Is there a macro key emulator? Software
Solved Need To Create A Macro! Microsoft Office
Start Menu - Replace Shut Down Button, with Lock Button Customization

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 06:58 PM.
Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33