Become a Columnist Microsoft Exchange Site Microsoft Support SiteMSDN Exchange Site

   

Subscribe to OutlookExchange
Anderson Patricio
Ann Mc Donough
Bob Spurzem
Brian Veal
Catherine Creary
Cherry Beado
Colin Janssen
Collins Timothy Mutesaria
Drew Nicholson
Fred Volking
Glen Scales
Goran Husman
Guy Thomas
Henrik Walther
Jason Sherry
Jayme Bowers
John Young
Joyce Tang
Justin Braun
Konstantin Zheludev
Kristina Waters
Kuang Zhang
Mahmoud Magdy
Martin Tuip
Michael Dong
Michele Deo
Mitch Tulloch
Nicolas Blank
Pavel Nagaev
Ragnar Harper
Ricardo Silva
Richard Wakeman
Russ Iuliano
Santhosh Hanumanthappa
Steve Bryant
Steve Craig
Todd Walker
Tracey J. Rosenblath
 
 

Render a Document in Exchange 2000

Rendering 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 link

Syntax

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


RETURN to my Article Index


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