Moving Emails Between Archive Folders

Status
Not open for further replies.

Spirit ICT

New Member
Best answers
0
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server 2010
I am new to VBA coding in Outlook and am struggling to follow some of the logic. I'm needing to move around 35,000 emails from an Archive folder "Deleted Items" one at a time to a Archive folder "Deleted." Our system prevents moving a batch of emails, based on size, and I don't want to break the 35,000 down manually. I'd rather have a macro that loops and moves each email one at a time.

I'm starting from scratch so any help would be appreciated.

Thanks in advance!
 

Diane Poremsky

Senior Member
Best answers
0
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
This macro can be tweaked to do that - Use a Macro to Move Aged Email in Outlook - assuming the Archive is a pst file, you'll use the second macro, that moves mail to a different data file.

You should just need to change these 3 lines:
Set objSourceFolder = objNamespace.GetDefaultFolder(olFolderDeletedItems)

'Use a folder in a different data file
Set objDestFolder = GetFolderPath("Archive\Deleted Items")

The default is mail older than 7 days - that can be changed to any value you want. 1 would be mail that is older than 24 hours; using 0.5 should work for older than 12 hours but i have not tested it.
If intDateDiff > 1 Then
 
Status
Not open for further replies.
Top