Dim OlApp As Outlook.Application Set OlApp = CreateObject("Outlook.Application") Dim fldrpath As String Dim oMails As Outlook.Items Dim oMail As Object fldrpath = "\\data\EMAILS\abc@gmail.com" Dim NS As Outlook.Namespace Dim Folder As MAPIFolder Dim Olfolder As Outlook.MAPIFolder Set NS = OlApp.GetNamespace("MAPI") Set Olfolder = NS.GetDefaultFolder(olFolderInbox) ' Check subfolder for messages and exit of none found Set oMails = Olfolder.Items Set oMail = oMails.Find("[Sendername]= 'abc@gmail.com'") While TypeName(oMail) <> "Nothing" oMail.Move fldrpath Set oMail = oMails.FindNext Wend
Sendername
SenderEmailAddress
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)