Deleting all messages from certain IMAP folders

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,
my wife is missing the "Empty Spam Folder" button in MS Outlook 2003 with
two IMAP accounts. Both accounts have that Spam folder. I tried but realized
that I don't understand Visual Basic at all :-( . Probably you could help us?
The task is to empty current IMAP folder (because of two such Spam folders).
It would be perfect to check if current folder name is "Spam" (I'm afraid she
can accidentally empty Inbox) but I don't know if it is easy or not.
Thank a lot in advance
 
Am Mon, 12 Dec 2005 23:13:02 -0800 schrieb Polykarp:

Sample:

Dim oFld as Outlook.MapiFolder
Set oFld=Application.ActiveExplorer.CurrentFolder
With oFld
If .Name = "Spam" Then
While .Items.Count
.Items(1).Delete
Wend
Endif
End With
 
Back
Top