Skip to content

Instantly share code, notes, and snippets.

@devhawk
Created May 13, 2013 17:55
Show Gist options
  • Save devhawk/5570128 to your computer and use it in GitHub Desktop.
Save devhawk/5570128 to your computer and use it in GitHub Desktop.
VBA macro to delete sub folders from Deleted Items in OUtlook
Sub RemoveAllDeletedItemsSubFolders()
Dim oDeletedItems As Outlook.Folder
Dim oFolders As Outlook.Folders
Dim oItems As Outlook.Items
Dim i As Long
'Obtain a reference to deleted items folder
Set oDeletedItems = Application.Session.GetDefaultFolder(olFolderDeletedItems)
Set oFolders = oDeletedItems.Folders
For i = oFolders.Count To 1 Step -1
oFolders.Item(i).Delete
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment