Internetkhazana

Permanently Delete Empty Folders in Outlook PST 2019/2016

How do I permanently delete PST files?

Microsoft Outlook is a leading email application that has been helping the professional workers to connect with each other since 2015. Crores of emails have been shared and thousands of deals have been made using this excellent application. Available as a part Microsoft Office Suite, this application is not restricted to just emails, but you can also use it as calendar, task manager, contact manager, notepad, journal book, and a web browser.

After having so many options, Microsoft Outlook still remains the primary application for transferring and receiving emails. So, it would not be an unusual situation that your inbox and sent folder might be brimming with thousands of emails which are not even needed anymore.

This article shall help you fix this situation by guiding you through the process of permanently deleting empty folders in MS Outlook, we have mentioned steps and also an effective tool such as stellar repair for outlook to recover deleted mails

How to permanently delete the Empty Folder in MS Outlook?

First of all, we need to understand that MS Outlook saves each and every file along with mailbox items in the format of .PST. So, when we are talking about deleting empty folders, we are referring to the .PST files that are sent to this folder.

To get through this process, you must follow the steps that are mentioned below:

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

What to do if I want to recover the permanently deleted empty folders?

In case you happen to delete some important .PST files along with the unnecessary ones, here is what you can do to get the data back:

Conclusion

At the end, we would like to suggest you to try using the Inbox Repair Tool to fix a corrupt .PST file but if it fails to do the job, then you must go with the Stellar Repair for Outlook. They have a demo version for you to check if the software will be able to do what you want it to, which will help you to make the right decision while making an investment in the DIY software.  Stellar a known brand for data care resolutions to customers, delivering data recovery solutions from all kinds of data loss situations.

Exit mobile version