![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#2
|
||||
|
||||
|
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 |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
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 |
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 |