Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-09-2021, 06:02 AM
KEL005 KEL005 is offline Need Help Finding Simply Way to move Massive Amount of Emails out of Deleted Folder Windows 10 Need Help Finding Simply Way to move Massive Amount of Emails out of Deleted Folder Office 2019
Novice
Need Help Finding Simply Way to move Massive Amount of Emails out of Deleted Folder
 
Join Date: Aug 2021
Posts: 1
KEL005 is on a distinguished road
Default Need Help Finding Simply Way to move Massive Amount of Emails out of Deleted Folder

In my favorites section of Outlook I have the following:



- Inbox
- Sent Items
- Deleted Items

One morning I accidentally right clicked "delete all" under my "sent items" folder. Now over 7,400 emails are in my "deleted items" folder. I can manually select each email and move them back to the appropriate folder. However, I cannot select more than a few because of the file size.

Is there a way to move all of these emails back to the "sent items" in one action? With over 7,400 emails it would take me several weeks to manually move them back.

Appreciate any recommendations!
Reply With Quote
  #2  
Old 08-10-2021, 01:14 AM
gmayor's Avatar
gmayor gmayor is offline Need Help Finding Simply Way to move Massive Amount of Emails out of Deleted Folder Windows 10 Need Help Finding Simply Way to move Massive Amount of Emails out of Deleted Folder Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The following macro should work. Change the email address(es) to the address(es) you used to send the mails.
Code:
Sub Macro1()
Dim oItem As MailItem
Dim lngCount As Long
    On Error Resume Next
    For lngCount = Session.GetDefaultFolder(olFolderDeletedItems).Items.Count To 1 Step -1
        Set oItem = Session.GetDefaultFolder(olFolderDeletedItems).Items(lngCount)
        If TypeName(oItem) = "MailItem" Then
            'Debug.Print oItem.SenderEmailAddress
            Select Case oItem.SenderEmailAddress
                Case "someone@somewhere.com"    'your email address
                    oItem.Move Session.GetDefaultFolder(olFolderSentMail)
                Case "someoneelse@somewhere.com" 'another email address
                    oItem.Move Session.GetDefaultFolder(olFolderSentMail)
                Case Else
            End Select
        End If
        DoEvents
    Next lngCount
    MsgBox "Complete", vbInformation
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help Finding Simply Way to move Massive Amount of Emails out of Deleted Folder VBA to move selected emails or conversation to current year pst folder webharvest Outlook 1 08-15-2015 01:55 AM
Emails will not go to deleted items folder VicV50 Outlook 0 03-22-2015 01:58 PM
Move emails to folder in drive and store in access database megatronixs Outlook 0 11-21-2014 06:19 AM
Need Help Finding Simply Way to move Massive Amount of Emails out of Deleted Folder Move emails from one folder to another smiler44 Outlook 9 11-20-2014 03:02 PM
move emails to folder with a subject that is similar megatronixs Outlook 0 10-14-2014 03:05 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:16 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft