<%
Dim ResultsString
Dim objFileSystemObject
Dim objTextStream
Dim strFileName

' grab the string, using a comma as a record separator and a tab as a record separator
ResultsString = "<html><head><title>Untitled Document</title>" &_
"<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>" &_
"</head><body></body></html>"

' create a link to the local file system on the server
Set objFileSystem = Server.CreateObject("Scripting.FileSystemObject")

' Create a text file and dump the contents of the string to the file,
' using the file name export with the current date and time as a way to seperate out differing users
strFileName="\export123.html"

Set objFile = objFileSystem.CreateTextFile(Server.MapPath(strFileName), True, False)
objFile.Write(ResultsString)

' Clean up
Set objFile = Nothing
Set objFileSystem = Nothing

' return a link to the file to the browser
Response.Write("The file <a href='" & strFileName &"'>" & strFileName & "</a> is now available to download")
%>