How to Quickly Find All Outlook Rules Whose Names Contain a Specific Keyword

Outlook doesn’t provide the inbuilt function to search rules. Therefore, if you would like to search the Outlook rules whose names contain a specific keyword, normally, you have to check all rules one by one. But this post will show you a much smarter method.

You can create various rules in your Outlook at will. The rules are able to make your work with incoming and outgoing emails automated and efficient. However, if there are too many rules in Outlook, you will feel it a bit difficult to manage and control them. For instance, if you wish to do something with the rules containing a certain keyword in the name, generally, you have to find them among all the rules manually. That would be a pretty arduous task. But don’t worry. Here we’ll share a more intelligent approach to you. It can let you find the specific rules in a jiffy.

Find All Outlook Rules Whose Names Contain Specific Keyword

  1. First, launch Outlook application.
  2. Next, access to the VBA editor with accordance to “How to Run VBA Code in Your Outlook“.
  3. Then, in the “Microsoft Visual Basic for Applications” window, copy the code below into a new module.
Sub FindAllRulesContainingSpecificKeywordInName()
    Dim objStores As Outlook.Stores
    Dim objStore As Outlook.Store
    Dim objRules As Outlook.Rules
    Dim i As Long
    Dim objRule As Outlook.Rule

    Set objStores = Outlook.Application.Session.Stores

    'Process all mailboxes
    For Each objStore In objStores
        Set objRules = objStore.GetRules

        For i = objRules.Count To 1 Step -1
            Set objRule = objRules.Item(i)
            'Find specific keyword in rule name
            If InStr(objRule.Name, "Shelly") = 0 Then
               objRule.Enabled = False
               objRules.Save
            Else
               objRule.Enabled = True
               objRules.Save
            End If
        Next i
     Next
 End Sub

VBA Code - Find All Outlook Rules Containing Specific Keyword

  1. After that, click the “Run” icon in toolbar to run this macro.
  2. When macro finishes, follow the steps below to check the filtered rules.
  • First off, go to “File” menu.
  • Then, click the “Manage Rules & Alerts” button on “Info” tab.Manage Rules & Alerts
  • Next, in the popup “Rules and Alerts” window, you can see that the rules containing the specific keyword in name are enabled and checked. But the other rules which don’t contain the keyword are disabled, as shown in the following screenshot.Specific Rules That Contain Specific Keyword

Troubleshoot Outlook Problems

It’s common to encounter a variety of Outlook issues if you have used Outlook for decades. They can be some tiny problems, like occasional small errors, or some serious troubles such as severely corrupt PST file. Generally, when encountering such Outlook problems, you can first restart it, then disable third party add-ins or rebuild mail profiles and finally resort to a professional and robust fix utility, like DataNumen Outlook Repair.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql corruption and outlook repair software products. For more information visit www.datanumen.com

Comments are closed.