
Originally Posted by
gmayor
If the Move doesn't work then either the Vendor folder doesn't exist or it is not where the macro expects it to be. What is the path of the folder?
it is a subfolder of the inbox. I will try the macro again and see if it still occurs.

Originally Posted by
gmayor
The macro uses case statements so if any of those statements is true, the test will be true.
So if it detects "gmail com" in the cc but does NOT contain ST26 in the subject line it will still move the email? I'm more looking to combine those two things as true
Must be true:
1. The subject contains ST26
2. One or more of the 3 email options (gmail, msn, outlook) is in the To or CC fields
so would this work?
Sub CheckAndMoveMail(olItem As MailItem)
Dim olFolder As Folder
Dim x As Long
If TypeName(olItem) = "MailItem" Then
With olItem
Select Case True
Case InStr(1, .CC, "gmail com") > 0
x = 1
Case InStr(1, .CC, "msn com") > 0
x = 1
Case InStr(1, .CC, "outlook com") > 0
x = 1
Case InStr(1, .To, "gmail com") > 0
x = 1
Case InStr(1, .To, "msn com") > 0
x = 1
Case InStr(1, .To, "outlook com") > 0
x = 1
Case InStr(1, UCase(.Subject), "ST26") > 0
x = x + 1
End Select
If x = 2 Then
Set olFolder = Session.GetDefaultFolder(olFolderInbox).Folders("Vendor")
olItem.Move olFolder
olItem.UnRead = True
End If
End With
End If
lbl_Exit:
Set olFolder = Nothing
Exit Sub
End Sub
that way if any of the emails are found x = 1 and then if ST26 is found x = 2 but if ST26 isnt found x = 1 or x = 0 would not move the mail