Hello,
I have a form located on a .htm page where someone can select a state. What I need to happen is once the user selects the state and clicks the Submit button, the code should search the specified network location for the existence of that state's document. If the document is found, then another .htm page should open containing a link to that document. Here is what I have so far:
On Error Resume Next
Dim objFSO, oFO, oFolder, oFile, TSADir, IE
Dim objStream
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objStream =
objFSO.createtextfile("K:\orkand\DAEBTools\TSASearch.htm",True)
CheckFolder(objFSO.getfolder("I:\CABINETS\TSB\TSAREPORT\")), objStream
Set IE = CreateObject("InternetExplorer.Application")
Sub Checkfolder(objCurrentFolder, objLogFile)
Dim strSearch
Dim strTemp
strSearch=document.getElementsByID("State").value
For Each objFile In objCurrentFolder.Files
strTemp=Left(objFile.Name,6,2)
If strSearch = strTemp Then
strOutput = "<A href=" & CStr(objFile.Path) & ">" & CStr(objFile.Path) & "</A>""
objLogFile.writeline strOutput
End If
Next
For Each objNewFolder In objCurrentFolder.subfolders
CheckFolder objNewFolder, objLogFile
Next
End sub
Any help you could provide would be appreciated.
...ecm
I have a form located on a .htm page where someone can select a state. What I need to happen is once the user selects the state and clicks the Submit button, the code should search the specified network location for the existence of that state's document. If the document is found, then another .htm page should open containing a link to that document. Here is what I have so far:
On Error Resume Next
Dim objFSO, oFO, oFolder, oFile, TSADir, IE
Dim objStream
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objStream =
objFSO.createtextfile("K:\orkand\DAEBTools\TSASearch.htm",True)
CheckFolder(objFSO.getfolder("I:\CABINETS\TSB\TSAREPORT\")), objStream
Set IE = CreateObject("InternetExplorer.Application")
Sub Checkfolder(objCurrentFolder, objLogFile)
Dim strSearch
Dim strTemp
strSearch=document.getElementsByID("State").value
For Each objFile In objCurrentFolder.Files
strTemp=Left(objFile.Name,6,2)
If strSearch = strTemp Then
strOutput = "<A href=" & CStr(objFile.Path) & ">" & CStr(objFile.Path) & "</A>""
objLogFile.writeline strOutput
End If
Next
For Each objNewFolder In objCurrentFolder.subfolders
CheckFolder objNewFolder, objLogFile
Next
End sub
Any help you could provide would be appreciated.
...ecm