PDA

View Full Version : Check for a specific word in emails.



lienlee
07-13-2011, 11:22 AM
Hi Guys,

I never did vba in outlook before but how would you search for a specific word in emails that are coming into mailbox and then "if = the word" forward an email replying "insert something to forward back"

not familiar with outlook functions..

AdonPr
07-14-2011, 01:20 PM
Im not sure on the forward email part but to check the email body i use


If InStr(Msg.Body, "UNIX") Then
Set fldr = Outlook.Session.GetDefaultFolder(olFolderInbox).Folders("Today's Work").Folders("14.Unix")
Msg.Move fldr
End If
Body can be replaced with Subject and SenderName to filter other emails :-)