| Platform SDK: Exchange 2000 Server |
[This is preliminary documentation and subject to change.]
By consulting the Web Store Property Namespaces in the Reference you can tailor your search queries to get all the information you need, and only the information you need.
This example gets the date, from, subject, and URL from each item.
Dim Rec
Dim Rs
Dim strURL
Dim strQ
Dim strSubj
Dim DomainName
Dim strLocalPath
Set Rec = CreateObject("ADODB.Record")
Set Rs = CreateObject("ADODB.Recordset")
'for large folders,
'you may need to increase
'script timeout
Session.Timeout = 1200
' set your own values to these variables:
DomainName = "bruceham2dom.extest.microsoft.com"
strLocalPath = "public folders/GDISC"
strURL = "file://./backofficestorage/" & DomainName & "/" & strLocalPath
Rec.Open strURL
strQ = "select "
strQ = strQ & " ""urn:schemas:mailheader:date"""
strQ = strQ & ", ""urn:schemas:mailheader:sender"""
strQ = strQ & ", ""urn:schemas:mailheader:subject"""
strQ = strQ & ", ""DAV:contentclass"""
strQ = strQ & ", ""DAV:href"""
strQ = strQ & " from scope ('shallow traversal of "
strQ = strQ & Chr(34) & strURL & Chr(34) & "') "
Rs.Open strQ, Rec.ActiveConnection
Rs.MoveFirst
Do Until Rs.EOF
Response.Write "Subject:<br>"
Response.Write Rs.Fields("urn:schemas:mailheader:subject").Value & "<br>"
Response.Write "Date Sent:<br>"
Response.Write Rs.Fields("urn:schemas:mailheader:date").Value & "<br>"
Response.Write "Content-Class:<br>"
Response.Write Rs.Fields("DAV:contentclass").Value & "<br>"
Response.Write "URL:<br>"
Response.Write Rs.Fields("DAV:href").Value & "<br>"
Response.Write "</p>"
Rs.MoveNext
Loop
Rs.Close
Rec.Close
The following example finds subfolders in a folder and lists their URLs. The search criteria to find subfolders specifies that the schema field DAV:iscollection is True.
Dim rs As New ADODB.Recordset
Dim Conn As New ADODB.Connection
Dim strURL As String
Dim Fld As ADODB.Field
'URL to a user's inbox
strURL = "file://./backofficestorage/thedomain.microsoft.com/mbx/user1/inbox"
Conn.Open strURL
rs.Source = "select ""DAV:href"" from SCOPE('shallow traversal of """ & url & """') where ""DAV:iscollection"" = true"
rs.ActiveConnection = Conn
rs.Open
rs.MoveFirst
MsgBox rs.RecordCount
While Not rs.EOF
Debug.Print rs.Fields("DAV:HREF").Value
rs.MoveNext
Wend
Set rs = Nothing