Can someone please help me get the OR statement to work?
When i have the code as below it works fine.
However if i add an OR statement so i can also check if "mytokenaccessgroups:" is in the body it marks all the emails as (AUTO_CHECKED)...Code:If currF.Name = "modifytest" Then If currF.Items.Count >= 1 Then For Each msg In currF.Items subjName = msg.subject If (InStr(1, subjName, "ACE-TOKENS") > 0 And InStr(1, subjName, "Modify") > 0 And InStr(1, subjName, "[") = 0 And InStr(1, subjName, "SUCCESS") = 0 And InStr(1, subjName, "FAIL") = 0 And InStr(1, subjName, "AUTO_CHECKED") = 0) Then If (InStr(1, findwhatever(msg.Body, "mytokennumber:"), "Empty") > 0) Then 'find user details useId = useId & Trim(findwhatever(msg.Body, "Login Id:")) & Chr(10) msg.subject = "(AUTO_CHECKED)" & msg.subject msg.Save ElseIf (InStr(1, findwhatever(msg.Body, "mytokennumber:"), "Empty") = 0) Then msg.subject = "(HAVE TOKEN)" + subjName msg.UnRead = True msg.Save End If End If
Code:If currF.Name = "modifytest" Then If currF.Items.Count >= 1 Then For Each msg In currF.Items subjName = msg.subject If (InStr(1, subjName, "ACE-TOKENS") > 0 And InStr(1, subjName, "Modify") > 0 And InStr(1, subjName, "[") = 0 And InStr(1, subjName, "SUCCESS") = 0 And InStr(1, subjName, "FAIL") = 0 And InStr(1, subjName, "AUTO_CHECKED") = 0) Then 'added or statement If (InStr(1, findwhatever(msg.Body, "mytokennumber:"), "Empty") > 0) Or (InStr(1, findwhatever(msg.Body, "mytokenaccessgroups:"), "Empty") > 0) Then 'find user details useId = useId & Trim(findwhatever(msg.Body, "Login Id:")) & Chr(10) msg.subject = "(AUTO_CHECKED)" & msg.subject msg.Save ElseIf (InStr(1, findwhatever(msg.Body, "mytokennumber:"), "Empty") = 0) Or (InStr(1, findwhatever(msg.Body, "mytokenaccessgroups:"), "Empty") = 0) Then msg.subject = "(HAVE TOKEN)" + subjName msg.UnRead = True msg.Save End If End If
Please note that if i use the first piece of code and change "mytokennumber:" to "mytokenaccessgroups:" it also works.


LinkBack URL
About LinkBacks
Reply With Quote
