Function Returning the HTTP URL of a File in the Store
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
The following example describes a Sendmail with a link to a file procedure, which sends an e-mail message containing a link to an HTTP URL of the message in the store.
Example Script
set oMapper = CreateObject("Exoledb.UrlMapper.1")
Dim fileURL
Dim filePath
Dim httpURL
Dim iPos
Dim iPathLength
Dim serverName
Dim path
Dim address
fileURL = WorkflowSession.Fields("DAV:href").Value
filePath = oMapper.ExoledbFileUrlToFilePath(fileURL)
httpURL = oMapper.FilePathToHttpUrls(filePath)
iPathLength = Len(httpURL(0)) ' get full length of http url
'extract the server name out of the the full domain
iPos = InStr(httpURL(0), ".") - 1
serverName = Left(httpURL(0), iPos)
'parse out the domain information
iPos = InStr(8, httpURL(0), "/") - 1
iPathLength = iPathLength - iPos
path = Right(httpURL(0), iPathLength)
'recreate the http url withouth the domain information
address = serverName & path
See Also
Scripting in the Workflow Designer for Exchange Server | Script Examples for Exchange Server | Creating Script Procedures