![]() |
|
|
| Become a Columnist Microsoft Exchange Site Microsoft Support SiteMSDN Exchange Site | ||
|
|
Render a Document in Exchange 2000Rendering a document via the browser that is stored in the Web Storage System (WSS) folder is very straightforward. You can achieve this simply by creating an HTML link that points to that document. There are many ways to accomplish this; I’ll show you two. In method one, you will manually construct the link. In method two, you construct links using the ADO object. Method one: Manually constructing the linkSyntax http://<Server Name>/<Folder Path>/<Document Name> Parameters <Server Name> Specifies the name of your Exchange 2000 server <Folder Path> Specifies the storage path of your document <Document Name> Specifies the name of your document Example The following example illustrates a manually constructed link. http://MyServer/MyStore/MyParentFolder/MyFolder/My.doc
Method Two: Constructing a document link using ADO The example code below will retrieve all documents in the http://Myserver/MyStore/MyParentFolder/MyFolder/ folder that are not hidden and have a display name of My.doc. This example will work exactly as method one does if the display name for you document is unique within the context of the folder. Please also reference my article on generating unique IDs. Example Set Conn = server.CreateObject("ADODB.Connection") Set Res = server.CreateObject("ADODB.Recordset") strDataURL = "http://MyServer/MyStore/" StrSQL = "SELECT ""DAV:herf"" " & _ "FROM SCOPE('SHALLOW TRAVERSAL OF """ & _ "http://MyServer/MyStore/MyParentFolder/MyFolder"" ') " & _ """DAV:ishidden"" = FALSE AND ""DAV:displayname"" = " & _ "'My.doc'" With Conn .Provider = "ExOLEDB.DataSource" .Open strDataURL End With With Res .Open StrSQL, Conn, adOpenForwardOnly, adLockReadOnly .MoveFirst Do Until .EOF strHREF = .Fields("DAV:href") Response.Write ("<A href='" & strHREF & "'>" & strHREF & "</A>") Loop .MoveNext End With
|
Disclaimer: Your use of the information contained in these pages is at your sole risk. All information on these pages is provided "as is", without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by Stephen Bryant or Pro Exchange. OutlookExchange.Com, Stephen Bryant and Pro Exchange shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.
Copyright Stephen Bryant 2008