I have the following macro in outlook to clear my deleted folder. its strange as it doesn't seem to delete all entries. I have to run this a few times for it to clear to deleted items folder. (usually 2 or 3 times). Each time the number of deleted items in the folder does get reduced but i dont understand why everything doesn't get wiped out in the first go. anything wrong with this code below ?
Public Sub EmptyDeletedEmailFolder()
Dim outApp As Outlook.Application
Dim deletedFolder As Outlook.MAPIFolder
Dim item As Object
Dim entryID As String
Set outApp = CreateObject("outlook.application")
Set deletedFolder = outApp.GetNamespace("MAPI").GetDefaultFolder(olFolderDeletedItems)
For Each item In deletedFolder.Items
item.Delete ' Delete from mail folder
Next
Set item = Nothing
Set deletedFolder = Nothing
Set outApp = Nothing
End Sub