Purge deleted messages from IMAP server MS Outlook

S

Sitchensis

Hi all,

I have used this code (below) to emulate programatically a user
clicking on the Purge Deleted Messages button in microsoft outlook to
remove completely deleted messages from an imap server (just deleting
will not work for POP3 or IMAP served mail). However, I then get the
confirmation dialog asking me whether I'm sure I want to delete same
messages.

Sub PurgeMessages()

Dim myBar As CommandBar
Set myBar = Application.ActiveExplorer.CommandBars("Menu Bar")
Dim myButtonPopup As CommandBarPopup
Set myButtonPopup = myBar.Controls("Edit")
Dim myButton As CommandBarButton
Set myButton = myButtonPopup.Controls("Purge Deleted Messages")
myButton.Execute

End Sub

I'd like to avoid the confirmation dialog, so is there any way to
emulate a return (yes confirmation) keystroke in the sub or must the
user always confirm yes in the dialog to delete the mail?

Any suggestions/workarounds? Thanks in advance for your time.
Sitchensis.
 
S

Sitchensis

Hi all,

I figured this one out myself. To stop the confirm deletion dialog go
to outlook main toolbar select tools>options> select the "other" tab,
selected the "advanced" button then uncheck the "warn before before
permanently deleting items" checkbox. From looking through previous
posts this issue seemed to be wrecking the heads of a few bods.. The
code in the above posting can then be used to automate your imap
deletions...

All the best Sitchensis...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top