Read time 5 minutes

Outlook relies on a database file (PST) to maintain the structural hierarchy of the mailbox and its folders. While some folders like Inbox, Sent Items, and Draft are pre-built, users can create additional ones. As emails are sent and received, the database file naturally increases in size, occupying storage space and necessitating efficient space management.

Outlook users have various options for managing PST data, including exporting it to different locations, archiving items, manual deletion, or migration to other platforms. Prior to undertaking these actions, it’s advisable to clear the PST of empty folders and sub-folders, streamlining the process and eliminating unnecessary complications.

Empty folders in Outlook can be both frustrating and confusing. Not only do they occupy space, but they also disappoint users when no emails are found within them. During the process of exporting items from the Outlook PST file, these empty folders may also be transferred, which is undesirable. Folders devoid of any data serve no purpose in their new location. Let’s explore effective methods for permanently removing these empty folders.

How to Permanently Delete Empty Folders in Outlook PST 2019/2016?

Deleting a small number of empty folders in Outlook is a straightforward process. Users can easily remove an empty folder by right-clicking on it and selecting the ‘Delete Folder’ option from the context menu.

However, when dealing with a large number of empty folders in Outlook, the manual deletion method becomes impractical and time-consuming. Therefore, it’s essential to explore alternative solutions to address this issue more efficiently.

If you’re using Outlook PST 2019/2016 and are willing to proceed, follow the provided steps to delete empty folders from Outlook.

Permanently Delete Empty Folders in Outlook PST 2019/2016 Using VBA Macro Code

This VBA Macro Code is designed to remove all empty sub-folders within an Outlook folder. Let’s break down the process step by step.

  1. Launch the Microsoft Outlook application.
  2. On the opened application, press the Alt and F11 keys to launch the Microsoft Visual Basic for Applications or move to the Developer menu and click on the Visual Basic option.Click on Visual Basic
  3. Go to the Insert menu and click on the Module option.Click on module option
  4. A new module window will get opened. Paste the following VBA macro code to delete all the empty subfolders from the Outlook folders.
  5. Public Sub DeletindEmtpyFolder()
    Dim xFolders As Folders
    Dim xCount As Long
    Dim xFlag As Boolean
    Set xFolders = Application.GetNamespace(“MAPI”).PickFolder.Folders
    Do
    FolderPurge xFolders, xFlag, xCount
    Loop Until (Not xFlag)
    If xCount > 0 Then
    MsgBox “Deleted ” & xCount & “(s) empty folders”, vbExclamation + vbOKOnly, “Kutools for Outlook”
    Else
    MsgBox “No empty folders found”, vbExclamation + vbOKOnly, “Kutools for Outlook”
    End If
    End Sub
    Public Sub FolderPurge(xFolders, xFlag, xCount)
    Dim I As Long
    Dim xFldr As Folder ‘Declare sub folder objects
    xFlag = False
    If xFolders.Count > 0 Then
    For I = xFolders.Count To 1 Step -1
    Set xFldr = xFolders.Item(I)

    If xFldr.Items.Count < 1 Then ‘If the folder is empty check for subfolders

    If xFldr.Folders.Count < 1 Then ‘If the folder contains not sub folders confirm deletion

    xFldr.Delete ‘Delete the folder

    xFlag = True

    xCount = xCount + 1

    Else ‘Folder contains sub folders so confirm deletion

    FolderPurge xFldr.Folders, xFlag, xCount

    End If

    Else ‘Folder contains items or (subfolders that may be empty).

    FolderPurge xFldr.Folders, xFlag, xCount

    End If

    Next

    End If

    End Sub

  6. To run this Macro code, either press the F5 key or click on the Run option.
  7. In the Select Folder dialogue box, select the Outlook folder for deleting its empty sub-folders and click on OK.select the Outlook folder
  8. Check if the subfolders are deleted now from the Outlook folders after restarting the Outlook application once.

This method requires a technical approach and should be followed meticulously to ensure precise results.

Identifying and manually deleting empty folders and sub-folders in Outlook can be a challenging task. We recommend an automated solution: the Kernel Outlook PST Reporter tool. This tool thoroughly scans your Outlook profile, generating detailed reports that include information about PST folder items, folder size, item types, and more. By pinpointing folders with zero file items, it simplifies the process of manual empty folder deletion, making it a more efficient task. This tool streamlines empty folder management for Outlook users.

In addition to identifying empty folders, the software generates multiple reports that offer valuable insights into Outlook data. Users can access crucial information, including read/unread message counts, email attachment types, sizes, and quantities. Visit our website to download this versatile tool for free and gain comprehensive control over your Outlook data management.

Summary

This blog addresses the issues caused by empty folders in the Outlook application and provides two genuine solutions for their permanent deletion, complete with step-by-step procedures. Additionally, a straightforward solution is introduced to help users identify empty folders within the Outlook PST file efficiently.

Kernel for Outlook PST Repair