69

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

Breakthrough
  • 34,227
  • 10
  • 105
  • 149
Marcelo Cantos
  • 1,561
  • 2
  • 12
  • 16
  • 14
    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 01: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... – Deacon Oct 21 '15 at 18:16

8 Answers8

41

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

Peter Mortensen
  • 12,090
  • 23
  • 70
  • 90
33

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
  • 349
  • 3
  • 2
11

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
  • 211
  • 2
  • 5
  • 1
    Not the ideal but it was a quite good approach without using VBA or third party filter. – Marco Jun 10 '21 at 16:11
3

If you know one of the words won't be in the body, say the words are A and B and B is not in the body, you can do

with A in the subject
 and with B in the subject or body
do whatever
except if the body contains B
ZygD
  • 2,459
  • 12
  • 26
  • 43
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")%
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
  • 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
  • 101
  • 1
0

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