title: outlook macro - why doesn't this delete all items from deleted folder?
body: <p>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 don't understand why everything doesn't get wiped out in the first go.</p>
  
  <p>Here is my code; Anything wrong?</p>
  
  <pre><code>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
  </code></pre>