How to Batch Clear All Color Categories in All Outlook Items

For some purposes, you want to start using color categories from scratch in your Outlook. Therefore, you would like to clear all color categories in all Outlook items. In this article, we will introduce an efficient means to get it.

For example, in order to rebuild color categories, you delete all the existing color categories in your Outlook. But, after deletion, you may find that these categories are still attached to the Outlook items. The only change is that the categories lose their original colors, displaying in white. Under this circumstance, you may hope to clear all color categories in all items.

Batch Clear All Color Categories in All Outlook Items

To do this for all items in one folder, you can just hit “Ctrl + A” to select all items, right click and choose “Categorize” and “Clear All Categories” from the context menu. But, in this way, you have to process every folder one by one. It is too tedious. So, in the followings, we will teach you a much more convenient method.Clear All Categories

Batch Clear All Color Categories in All Outlook Items

  1. For a start, launch Outlook application.
  2. Then, press “Alt + F11” key shortcuts to trigger VBA editor.
  3. In the displaying new window, copy and paste the following VBA code into an empty module or project.
Sub BatchClearAllColorCategories_AllOutlookItems()
    Dim objOutlookFile As Outlook.Folder
    Dim objFolder As Outlook.Folder
 
    'Change "John Smith" to your own Outlook file's display name
    Set objOutlookFile = Outlook.Application.Session.Folders("John Smith")
  
    For Each objFolder In objOutlookFile.Folders
        Call ProcessFolders(objFolder)
    Next
 
    MsgBox "Completed!", vbInformation + vbOKOnly
End Sub

Sub ProcessFolders(ByVal objCurrentFolder As Outlook.Folder)
    Dim objItems As Outlook.Items
    Dim objSubfolder As Outlook.Folder
 
    If objCurrentFolder.Items.Count > 0 Then
       For Each objItem In objCurrentFolder.Items
           'Clear all color categories from an item
           If Len(objItem.Categories) <> 0 Then
              objItem.Categories = ""
              objItem.Save
           End If
      Next
    End If
 
    'Process all subfolders recursively
    If objCurrentFolder.Folders.Count > 0 Then
       For Each objSubfolder In objCurrentFolder.Folders
           Call ProcessFolders(objSubfolder)
       Next
    End If
End Sub

VBA Code - Batch Clear All Color Categories in All Outlook Items

  1. After that, place the cursor into the first subroutine and then press “F5” key button to trigger macro.
  2. When you get the “Completed” prompt, it means that all the color categories have been cleared from all Outlook items.
  3. At present, No matter emails, appointments, tasks, contacts or notes in your Outlook, all of them must have no color categories assigned absolutely.Cleared Color Categories

Resolve Serious Outlook Problems

Maybe you’ve known that Outlook comes preinstalled with a built-in repair tool – Scanpst.exe. Have you ever tried it before? To be honest, it is powerful enough to deal with small troubles involving your Outlook PST file. However, if the issue is considerably severe, such as badly damaged Outlook file, the internal utility will not make effects. In this situation, you have to fall back on a tip-top external tool, such as DataNumen Outlook Repair, which has shouldered over its rivals due to its high PST recovery.

Author Introduction:

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

Comments are closed.