home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 1999 November / PCW9911.BIN / sharewar / prx / wscripts / Filter.exe / Filter.vbs
Encoding:
Text File  |  1999-08-12  |  1.3 KB  |  44 lines

  1. ordner=inputbox("Hier Pfad angeben:","Dateisuche")
  2. If ordner="" Then ordner="C:\"
  3. DateiFilter=ucase(inputbox("Filter angeben (z. B. XLS)","Dateisuche"))
  4. If DateiFilter="" Then DateiFilter="DOC"
  5.  
  6. Set ie4=CreateObject("InternetExplorer.Application")
  7. ie4.navigate ("about:blank")
  8. ie4.visible=1
  9.  
  10. Set FSys=CreateObject("Scripting.FileSystemObject")
  11. Set TheFolder = FSys.GetFolder(Ordner)
  12. ie4.document.body.innerHTML="<p id='idOutput'>"
  13.  
  14. SubFolders TheFolder, DateiFilter
  15. YesNo=MsgBox("Ausdrucken?", vbYesNo)
  16. If YesNo = vbYes Then ie4.ExecWB 6, 2
  17. Set ie4=nothing
  18. Set fSys=nothing
  19.  
  20. Sub SubFolders(ByVal AFolder,  TheExtension)
  21.         strOut="<b>" & AFolder & "</b><br>"
  22.         ie4.document.all.idOutput.insertAdjacentHTML "BeforeEnd", strOut
  23.         ShowFilesWithExtensionIn AFolder, TheExtension
  24.         Set MoreFolders = AFolder.SubFolders
  25.         For Each TempFolder In MoreFolders
  26.           SubFolders TempFolder, TheExtension
  27.         Next
  28. End Sub
  29.  
  30. Sub ShowFilesWithExtensionIn(AFolder,TheExtension)
  31.    header="<H1>Inhalt von: " & folderspec & "</H1> <p>"
  32.    Set TheFiles = AFolder.Files
  33.   
  34.    For Each AFile In TheFiles
  35.    If UCase(FSys.GetExtensionName(AFile.Path)) = TheExtension Then
  36.       s=ucase(AFile.Path)
  37.       s = s & "<br>"
  38.     ie4.document.all.idOutput.insertAdjacentHTML "BeforeEnd",  s
  39.     End If
  40.   Next
  41. End Sub
  42.  
  43.  
  44.