I am trying to get Outlook messages which makes two criteria’s simultaneously - they are from a specific sender, and their subject contains one of two possible texts. When I was trying to do it only for Subject with simple OR it’s working, but with adding FROM parameter I am getting error and I do not know what is causing it.
The systax I am using in filter is:
“[FROM] = " & MailSender.ToString & " AND ([SUBJECT] = '” & SubjectFirst.ToString & “’ or [SUBJECT] = '” & SubjectSecond.ToString & “’)”
And lets say that MailSender is = "firstname.lastname@example.org" , SubjectFirst = “abc” , SubjectSecond = “def”
Can you please help me with it?