Forum Discussion
Sameer_Kuppanath_Sultan
Nov 24, 2020Brass Contributor
VBA - Moving a mail from inbox to a specific folder
Hi every One, greetings I have to do the following. I need a vba for, moving a mail in outlook inbox to a specified folder in outlook based on either Sender name or sender mail or mail subjec...
NikolinoDE
Nov 26, 2020Platinum Contributor
Maybe this approach could help you resolve your issue.
Please adjust in your code
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If TypeOf Item Is Outlook.MailItem Then
SaveSentMail Item
End If
End Sub
Private Sub SaveSentMail(Item As Outlook.MailItem)
Dim Inbox As Outlook.MAPIFolder
Dim Subfolder As Outlook.MAPIFolder
If Item = "Nikolino" Then
Set Inbox = Application.Session.GetDefaultFolder(5)
Set Subfolder = Inbox.folders("0200 Nikolino").folders("General")
Set Item.SaveSentMessageFolder = Subfolder
End If
Sorry that I haven't been able to offer you a quick, acceptable solution until now.
Will keep you updated
Thank you for your patience and time.
Nikolino
I know I don't know anything (Socrates)
Sameer_Kuppanath_Sultan
Nov 28, 2020Brass Contributor
- NikolinoDENov 28, 2020Platinum Contributorits for Excel
- Sameer_Kuppanath_SultanNov 28, 2020Brass Contributor
NikolinoDE It will not work. Could you paste the whole code then.
- NikolinoDENov 28, 2020Platinum Contributor
I was also able to pick this up.
From one folder to another.
Thank you for your understanding and patience
Nikolino
I know I don't know anything (Socrates)