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."?

  • 11
    As 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 Sep 10 '09 at 1:44
  • 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. Oct 21 '15 at 18:16

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.


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

  • Wow, I had no idea you could write filters in VBA! That's perfect for me, thanks. – Marcelo Cantos Sep 10 '09 at 5:00
  • 8
    Because of things like this in general, I am confused why everyone at Microsoft hasn't died from embarrassment yet. – David Ljung Madison Stellar Dec 17 '18 at 20:16

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.

  • 1
    The OP mentioned this exact workaround in a comment six years ago. – Scott Oct 15 '15 at 20:57
  • 8
    It's a shame the OP didn't provide this workaround as an answer. I didn't see it in the chatter. – Rich Sep 6 '16 at 17:33
  • This workaround didn't work reliably for the OP... – 00prometheus Dec 19 '16 at 13:35
  • 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 Mar 5 '18 at 21:13
  • There also still or operator we get – Tinkaal Gogoi Aug 30 '18 at 12:18

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.


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")%

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.


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".


I couldn't find any other simpler way but found one way you can use two keywords in AND condition from Subject line,

check the image at below link for details,

Two keywords in AND condition from subject line

  • Welcome to Super User! Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change. – DavidPostill Nov 28 '20 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.