For the longest time, I’ve been using Advanced Find and enabled its Query Builder to perform searches with multiple criteria and Boolean statements.
This worked quite well but I found out that Microsoft is removing Advanced Find from future Outlook 2016 releases.
How am I supposed to perform Boolean and multi criteria searches in Outlook now?
The Advanced Find dialog indeed provided a nice WYSIWYG interface to build more complex search queries with relative ease.
What remains is the Search field at the top of your message list and although this might look quite Spartan at first, it’s actually quite powerful when you know the correct search query syntax and field names.
Search query example
How to perform a Boolean search with multiple search criteria might be best explained with an example.
In this example, we’re going to search our entire mailbox for emails that have an invoice attached to them but are not from Amazon. The envisioned query in words is as follows;
- The word “invoice” in either the subject OR the body,
- Has an attachment,
- NOT be from Amazon,
- Should search all mail folders.
The actual search for this example query is;
(subject:invoice OR body:invoice) AND hasattachments:yes NOT from:Amazon
In addition, you’d set the Search Scope to Current Mailbox. This can be done via the dropdown list next to the Search field or the Scope group on the Search.
Breaking down the example
So how does this query work?
First of all, we are directly targeting the fields that we want to query. Some of them are quite straightforward like “subject”, “body” and “from” while others can be inserted via the Refine group on the Search tab or by looking them up in this reference guide.
By using brackets, we can isolate the OR query and basically join the results for the Subject and Body fields.
With the AND statement, we are looking in these joined results and only select those which contain attachments.
With the NOT statement, we are filtering the results even further and discard the emails that are from Amazon from the results. So basically you could also read it as “AND NOT”.
Alternative: Use Search Folders, especially for repeated searches
As you can imagine, there are some search queries which can get quite complex or long to type and you might long for that WYSIWYG editor again.
Luckily, there still is a way to get it by creating a Search Folder. The added benefit is that you can save your Search Query for reuse or create a Search Folder for the static part of your query and use the Search field for the variables like for instance the Date or From field.
Step 1: Enable the Query Builder
If you haven’t done so already, enable the Query Builder in Outlook by creating the following Registry key.
- Open the registry editor:
- Browse to the following location in the registry
- Choose: Edit-> New Key
- Name the key:
Step 2: Create the Search Folder
Now you can create a Search Folder and use the Query Builder tab to construct your query.
- Create a new Search Folder
- Outlook 2007
File-> New-> Search Folder
- Outlook 2010, Outlook 2013 and Outlook 2016
tab Folder-> New Search Folder
- Keyboard shortcut
- Outlook 2007
- At the bottom of the dialog, select: Create a custom Search Folder.
- Press the Choose… button.
- Specify a name for your Search Folder.
- Use the Browse… button to select which folders to search in.
- Press the Criteria… button.
- Select the Query Builder tab to construct your Boolean Search Query.
Part of the Boolean Search Query can be saved as a Search Folder as well. To get the same results as from the example, all you’d have to do is press the “Has Attachments” button on the Search tab of the Ribbon.