Attribute VB_Name = "Module1"
Sub main()
Dim oCon As New ADODB.Connection
Dim oRS As New ADODB.Recordset
Dim strURL As String
Dim strSQL As String

strURL = "file://./backofficestorage/ywd.extest.microsoft.com/mbx/user1/inbox/"

With oCon
    .ConnectionString = strURL
    .Provider = "Exoledb.DataSource"
    .Open
End With

strSQL = "SELECT ""DAV:href"", ""http://schemas.microsoft.com/mapi/proptag/0x001a001f"" " & _
        "FROM SCOPE('shallow traversal of """ & strURL & """') " & _
        "WHERE ""urn:schemas:httpmail:subject"" = 'Test Subject'"
Debug.Print strSQL

oRS.Open strSQL, oCon

Do Until oRS.EOF
    Debug.Print oRS.Fields("DAV:href").Value
    Debug.Print oRS.Fields("http://schemas.microsoft.com/mapi/proptag/0x001a001f").Value
    oRS.MoveNext
Loop

Set oCon = Nothing
Set oRS = Nothing
End Sub
