Using Query Builder

Last reviewed on October 18, 2012

There is a filter option available that works with Views, Search folders, Advanced Find, and Automatic (Conditional) formatting. It’s called Query Builder and it’s simple to enable and easy to use. To enable it, add the appropriate key called QueryBuilder to your registry.

HKEY_CURRENT_USER\Software\Microsoft\Office\xx.0\Outlook\QueryBuilder

where xx.0 equals your Outlook version number.

Use the query builder to create filtersTo use the QueryBuilder, select the QueryBuilder tab from the Filter dialog and select or enter the criteria. After adding two or more conditions, select a group and choose the AND or OR operator from the logical group menu. Create nested conditions by moving the criteria up or down.

For example, QueryBuilder allows you to create one filter that looks for messages received today from Mary OR for messages received today which request a read receipt. Using the Advanced filter you needed two separate filter rules, one for each condition. QueryBuilder needs just one rule and looks like this:

- AND
messages received today
- OR
from Mary
request a read receipt

You’re probably wondering why QueryBuilder remains largely unknown when the ability to create OR filters is often requested. Apparently QueryBuilder can cause instability in Outlook. Your mileage may vary, but I’ve used it off and on since Outlook 2002 without a problem and it’s worth trying if you need to create filters using OR.

Don’t want to edit your registry? See Do it for me for reg files. Download then double click on the file to make the change to your registry.

Do it for me

Click on the appropriate link to download a registry file (*.reg) containing the QueryBuilder key and add it to your registry. If you want to view the file before installing it, save it to your hard drive and open the *.reg file in Notepad. To install, double click on the file.

Outlook 2013 Query Builder Outlook 2013 Outlook 2010 Outlook 2010 Outlook 2007 Outlook 2007 Outlook Outlook 2003 Outlook 2002 Outlook 2002

You do not need to close Outlook or restart it after adding the key to your registry.

Query Builder and From Addresses

The problem: You want to use Query Builder to create a Search folder that filters by email address, but Outlook’s Query Builder appears to ignore the email address and uses the display name instead. The only time it works as expected is when the email address is the display name.

The cause: The filter dialog has two From fields. The From field on the first tab uses the email address while the From field you use on the Advanced tab uses the display name. The Query Builder uses the same From field used by the Advanced tab.

The solution: Install a CFG to expose the email address field then use that field in your query. We have a custom CFG available for download along with installation instructions available at Adding Extended MAPI Fields to Outlook.

 

Written by

Diane Poremsky
A Microsoft Outlook Most Valuable Professional (MVP) since 1999 and involved in IT support since 1985, Diane is the author of several books and video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.