To automatically move emails from a specific sender to a designated folder in Outlook using VBA, use the following script in the “ThisOutlookSession” module :
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim ns As Outlook.NameSpace
Dim inbox As Outlook.MAPIFolder
Dim targetFolder As Outlook.MAPIFolder
Dim item As Object
Dim mail As Outlook.MailItem
Dim entryID As Variant
Set ns = Application.GetNamespace("MAPI")
Set inbox = ns.GetDefaultFolder(olFolderInbox)
Set targetFolder = inbox.Folders("TargetFolderName") ' Change to your target folder name
For Each entryID In Split(EntryIDCollection, ",")
Set item = ns.GetItemFromID(entryID)
If TypeOf item Is Outlook.MailItem Then
Set mail = item
If mail.SenderEmailAddress = "specificsender@example.com" Then ' Change to the specific sender's email address
mail.Move targetFolder
End If
End If
Next
End Sub?