in

jetlounge

the minty fresh blog that whitens your teeth!


Syndication


The Undocumented Query Builder tab in MS Outlook

by David Leibowitz | July 28, 2008 | Comments: 1

Adding the Query Builder tab to the Filter Page in Outlook 2007

Outlook has an undocumented feature to add a query builder from within the custom filter tab in custom views. This is very useful in generating search strings in automation (VBA, VSTO, .NET, etc). Build the filter, then copy and paste into your code.

To display the Query Builder page on the Filter dialog box :

  1. Click Start, point to Run, type Regedit in the Run dialog box, and then click OK to launch the Windows Registry editor.
  2. In the Registry tree, navigate to HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook.  (for earlier versions of Outlook, change the version number from 12.0 to your version..ie 10)
  3. Select New from the Edit menu, and then select Key from the New submenu.
  4. Name the key: QueryBuilder.
  5. Save and Close 
     
    To build a filter using the Query Builder page on the Filter dialog box

 

  1. In Outlook, select Current View from the View menu and then select Customize Current View from the Current View submenu.
  2. Click the Filter button on the View Summary dialog box.
  3. Click the Query Builder page on the Filter dialog box.
  4. Use the Query Builder interface to build your query. When you construct a filter, you actually build a WHERE clause without the WHERE keyword. Notice that you can use the logical AND or logical OR operator to develop the query and move clauses up or down.
  5. Click the SQL page shown in Figure 11-2 on the Filter dialog box, and clear the Edit These Criteria Directly check box. Once you clear the check box, you can copy the query by selecting it and pressing Ctrl+C to copy to the Clipboard.
  6. Because you don't want to modify the view, click Cancel to dismiss the Filter dialog box. Then click Cancel again to dismiss the View Summary dialog box.

 

 

del.ico.us digg this technorati BlinkList Furl reddit DotNetKicks google! live Facebook Stumble Upon Yahoo!



Comments

 

JP said:

David,

This works in OL 2003 as well. Although the path is slightly different; you go to View > Arrange By > Current View > Customize Current View. And in the Filter box, there is a"SQL" tab which displays the query in DASL.

You can do the same thing in Excel by creating an external data query and opening it in MS Query. Then you can save the .dqy file and open in with a text editor like Notepad and use/edit the generated SQL for other purposes.

Thx,

JP

July 30, 2008 2:31 PM

Leave a Comment

(required)  
(optional)
(required)  
Add
Powered by Community Server (Non-Commercial Edition), by Telligent Systems