Can I use "AND" in Outlook filters?

45

6

I wish to create an Outlook rule that matches two non-adjacent words in the subject line. It must match both words (AND), not one or the other. If I add the two words as one entry it treats them as a phrase rather than two distinct words, and if I add them as separate entries, it places an "OR" between them. Creating two rules doesn't work either, as they behave just like the "OR" case.

Is there any way to say, in effect, "Apply this rule to emails matching ALL of the following words."?

Marcelo Cantos

Posted 2009-09-10T01:42:37.087

Reputation: 1 321

Sigh. I thought I had hit on something when I used the "with xxx in the subject" and "with xxx in the subject or body." It worked perfectly with one rule, not at all with any other rule. And then when I modified the rule it was working for, it stopped working on that one too... – Doug R. – 2015-10-21T18:16:05.833

11As a work-around, I can add one word to "with xxx in the subject" and the other word to "with xxx in the subject or body". This isn't reliable, however, so I'd still like to know if a better solution exists. – Marcelo Cantos – 2009-09-10T01:44:16.803

Answers

23

I'm afraid the answer is no.

You can't change the logic from the Rules Wizard itself. It's preset for "usual" requests. I tested a few different wizard options for you though.

If you key in the whole phrase (instead of just one word at a time) as one submission (e.g. "How do you get there") it will filter any messages that comes through with all the words in that order. That helps (maybe!) but if you get a message that has, "how do you ALWAYS get there" it won't activate the filter so it might not meet your needs. If you already know the difference between the AND and OR controller then you probably already know that this won't help you ;)

As you've already discovered, if you drop each word in separately, it will use the "or" controller and you'll filter out a lot more messages than you want.

You CAN import custom scripts for your Outlook rules but you have to use VBScript and you have to craft the rules in VBScript for applications, not just the editor. It's proprietary to Microsoft Corp.

There is an expanding knowledge base article from Microsoft

It's got examples of code you can use but you have to draft it from VBScript for applications as mentioned above.

You might consider a third party filter.

Source

(This question has been asked many times and the conclusion is always the same.)

Molly7244

Posted 2009-09-10T01:42:37.087

Reputation:

4Because of things like this in general, I am confused why everyone at Microsoft hasn't died from embarrassment yet. – David Ljung Madison Stellar – 2018-12-17T20:16:51.063

Wow, I had no idea you could write filters in VBA! That's perfect for me, thanks. – Marcelo Cantos – 2009-09-10T05:00:56.540

15

I found a way around this. If you use the rule "with specific words in the subject" and then also use the rule "with specific words in the subject or body" then you can link two phrases together that are both in the subject with the "and" operator.

JayG

Posted 2009-09-10T01:42:37.087

Reputation: 161

1The OP mentioned this exact workaround in a comment six years ago. – Scott – 2015-10-15T20:57:17.613

7It's a shame the OP didn't provide this workaround as an answer. I didn't see it in the chatter. – Rich – 2016-09-06T17:33:12.553

This workaround didn't work reliably for the OP... – 00prometheus – 2016-12-19T13:35:19.080

Then if you get an email with the 1st word in Subject and the second in Body you sent the email to the wrong folder. – juanmf – 2018-03-05T21:13:37.793

There also still or operator we get – Tinkal Gogoi – 2018-08-30T12:18:04.557

6

So, ehm, this is kind of ridiculous but it should work.

  1. Create a new temporary category
  2. Create a first rule that filters based on the first phrase and let it assign the temporary category (rule: assign it to the category category)
  3. Create a second rule that filters on the temporary category (rule: assigned to the category category) and on the next phrase and does the action you want to do
  4. Create a third rule that removes the temporary category (rule: clear message's categories) from all mail

Make sure the order is correct though, the first rule should execute first so put in top etc.

If you need more than 2 AND phrase matches you'll need another temporary category.

Didii

Posted 2009-09-10T01:42:37.087

Reputation: 161

0

You can use SQL filter. Here example of filtering all tasks which is not done, AND tasks completed in last 7 days:

http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/811c000b" = 0 OR %last7days("http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/810f0040")%

Alexander Teterkin

Posted 2009-09-10T01:42:37.087

Reputation: 1

0

If one of the two words belongs to a predefined list of words, you can filter on it by creating an exception condition to exclude the other words of the predefined list.

IanM

Posted 2009-09-10T01:42:37.087

Reputation: 1

0

I think only server rules have this restriction. If you create a local rule you can add multiple filters for the same field and make the rules be "all" or "any".

miguel

Posted 2009-09-10T01:42:37.087

Reputation: 101