PDA

View Full Version : Automate "empty deleted Items" from code



gcomyn
07-29-2010, 03:12 PM
I've got some code that allows me to go through all of the folders in my namespace, extract the information on the emails and put them into an access (2007) table, save any attachments into a folder system, save the email into the same folder as the attachments as a .msg, then delete the email.

I want to automate the emptying of the deleted items folder, so that, after each folder, it will be empty...

right now, I have alot of emails that are archived, and when I bring them back, and resurrect them from the 'vault' my mailbox is too full to do anything.

In the future, it shouldn't be any problem... but I want to put it in the code, if it can be done, now... that way, i don't have to remember to empty it afterward...

any help would be appreciated.

(after i get the code like I want it, I'll be posting it)

GComyn
:sleuth:

JP2112
08-13-2010, 05:19 PM
The simplest way would be to loop through the Deleted Items folder and delete each item found there. That will permanently delete the messages.

http://www.codeforexcelandoutlook.com/outlook-vba/delete-expired-items/

gcomyn
08-16-2010, 07:50 AM
Thanks... seems to be the way to do it.

GComyn
:sleuth: