Share via


Finding DASL Property Names

The LINQ-to-DASL provider of the Office Interop API Extensions provides a very limited set of mappings between its query types and their associated DASL properties.  We didn't have the time to add them all and we didn't know which properties (besides the obvious ones like Subject and DateReceived) users would be most likely to use in their queries.  Instead, we created an extensibility mechanism (the OutlookItemPropertyAttribute) that allowed users to add their own mappings to DASL properties.  Now the problem becomes, where do we find these DASL property names?

You can find some of the property names amongst the MSDN Office and Exchange documentation, but many properties are missing and sometimes the documentation is misleading (e.g. a listed property may work when querying Exchange but not Outlook).  Outlook supports another query syntax (Jet) that uses a different set of property names, making the documentation even more confusing.

The best approach that I have found is to go directly to the source.  Outlook actually has a built-in DASL query builder, if only you know how to find it.  Here's the trick: start with the View : Current View : Customize Current View menu item.

ViewMenu

This displays the Customize View Messages dialog. 

CustomizeCurrentView

Next, click the Filter button.

AdvancedTab

The filter dialog allows you to filter messages in a folder by a variety of criteria.  Select the Advanced tab.

FieldMenu

Now use the Field button to select the Outlook item property you are interested in.

FieldConditionAndValue

You can then select the condition and a value.  Click the Add to List button to add the criteria to the filter.

CriteriaAdded

Finally, select the SQL tab to see the DASL. 

SqlTab 

In this case, we see that the DASL property associated with the Modified time of an appointment is "DAV:getlastmodified".  To cut and paste the query string elsewhere (e.g. to Notepad, so you can compare the query string to the debug output of your LINQ-to-DASL query), check the box at the bottom of the tab.

SelectedDasl