use vba or vb to permanently delete unopened deleted items

B

bbxrider

about 1/2 of my email now is junk spam that i just delete but it still ends
up in the deleted folder wasting space and search time, etc.
i would like to write a hopefully quick program to permanently delete all
unopened mail in the default outlook deleted folder, before i spend too much
time, just trying to find out if its technically possible and perhaps some
quick hints on how to go about it.
 
K

Ken Slovak - [MVP - Outlook]

The Outlook Delete methods only send items to the Deleted Items
folder. To achieve the equivalent of a Shift+Delete (hard delete that
bypasses Deleted Items) in code you have to use CDO 1.21 code to get
the item as a CDO Message and then use CDO's Delete method to hard
delete the item.

See www.cdolive.com/cdo5.htm for CDO code samples.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 

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