How can I increase/faster outlook VBA Macro Speed ?

Status
Not open for further replies.

nbm1515

New Member
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
Hi

Can someone help me with following code to increase/faster outlook VBA Macro Speed ? Currently It taking lot of time run all email rules and getting process slow.



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
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
In general the performace is better if you forego the progress dialog. Instead, simply display a MsgBox when done. Also, joining the rulelist string could take one or more seconds for 1000 loops. Since you run all rules, why not just say that instead of listing all the rule names?
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
J Increase font size of message body Using Outlook 5
C Increase Outlook 2013 message window row height Using Outlook 2
O How to increase Font size in Outlook 2013 Using Outlook 1
A OL 2007 problem - sudden large increase in message size Using Outlook 12
M Increase "Move To" List Length Using Outlook 3
J Can't Increase Outlook 2007 PST size Using Outlook 2
S Configure Increase Outlook 2007 PST size limit Using Outlook 1
S RBAC for Mail quota increase Exchange Server Administration 2
B Emails come back saying byte size is too large for attachments. How do I increase the allowable byte size? Using Outlook 1
R How To Increase Text Size Permenantly When Viewing Emails? Using Outlook 6
A Outlook 2003 - Increase number of calendars that show up under "Other Calendars" Using Outlook 3
P how to increase size of mail box size to unlimit in exchnge 2010 Exchange Server Administration 2
L unexplained public folder size increase Exchange Server Administration 7
T how do I get mail files to OPEN faster? Using Outlook 2
1 Faster Initial Loading Using Outlook 1
K Microsoft Outlook - How do you get your incoming mail off the browser and in your inbox faster? Where is the send and receive setting Using Outlook 1
P outlook 2008 search box criteria couldn't be saved Using Outlook 2
pcunite Outlook 2019/O365 Build 13127.20408 errors when using MAPI calls Using Outlook 1
C Outlook with Office365 - search across account, by date rate, in multiple folders - how? Using Outlook 1
D Outlook 2010 Outlook in Windows 10 keeps asking for user name and password repeatedly Using Outlook 14
S Outlook mail adressing stops after first match in GAL Using Outlook 0
A Apply Selected Emails to outlook rules and Run Rules Using Outlook 5
T Changing Sent Items location in Outlook 2019 Using Outlook 0
J How do I disable advertising in Outlook 2019? Using Outlook 10
S Outlook (2016 32bit; Gmail IMAP) - Save sent message to Outllook Folder Outlook VBA and Custom Forms 0
L Unable to Sync Web/Android MS To Do with Windows Outlook Tasks Using Outlook 3
S Macro to move “Re:” & “FWD:” email recieved the shared inbox to a subfolder in outlook Outlook VBA and Custom Forms 0
S Outlook Macro to send auto acknowledge mail only to new mails received to a specific shared inbox Outlook VBA and Custom Forms 0
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0
B Outlook Calendar not coming down from cloud Using Outlook 2
Terry Sullivan Sender's Name Doesn't Appear in the From Field on Outlook 365/IMAP Using Outlook 2
GregS Outlook 2016 Can I disable the Outlook Outbox? Using Outlook 2
P Outlook pst file is too huge with POP3. How to save more space? Using Outlook 4
D Outlook Contacts Notes Field Photos to Smartphone Using Outlook 0
Paula S. Outlook 2013 won't recognize new password Using Outlook 4
J Want to learn VBA Macros for Outlook. What book can you recommend? Outlook VBA and Custom Forms 2
A Backup Email Accounts On OutLook For Mac 2016 (Microsoft 365 subscription version) Using Outlook 0
J Time Zone Issues - Outlook Calendar and Webcal Feed Using Outlook 8
J Are the underlined letters in Outlook Reminders window supposed to work? Using Outlook 0
M Office 2016 Outlook is forgetting passwords Using Outlook 15
G How to add a folder shortcut to outlook quick access toolbar? Using Outlook 6
W Outlook WAS facebook but there is no info for old accounts Using Outlook 0
E Can one still buy Outlook (or Office) 2016? Using Outlook 6
G Add to Outlook Contacts - Point to non-default contacts folder Using Outlook 0
E Outlook view grouping keeps changing Using Outlook 3
Wayne Outlook locks up when opening "Manage Rules & Alerts" Using Outlook 3
G Personal Settings within Outlook Using Outlook 2
M Outlook 2013 reminder email by using Outlook vba Outlook VBA and Custom Forms 2
H Outlook 2019 Certificate error Using Outlook 2
B Outlook 2013 erratically deleting original file that is attached Using Outlook 0
Similar threads


















































Top