home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 July & August / PCWorld_2005-07-08_cd.bin / software / vyzkuste / tipy / tipy.exe / pcwseznam.bas < prev    next >
BASIC Source File  |  2005-05-11  |  3KB  |  97 lines

  1. Attribute VB_Name = "Modul2"
  2. Dim n
  3. Dim dname(10000)
  4. Dim dordner(10000)
  5. Dim dcreated(10000)
  6. Dim dpfad(10000)
  7. Dim dlast(10000)
  8. Dim dtyp(10000)
  9. Dim dsize(10000)
  10.  
  11. Sub Seznam_souboru()
  12. n = 0
  13. Set MyShell = CreateObject("wscript.shell")
  14. Set MyFiles = CreateObject("Scripting.FileSystemObject")
  15. Set Appshell = CreateObject("Shell.Application")
  16. On Error Resume Next
  17. Set AppFolder = Appshell.BrowseForFolder(0, "", &H1, 17)
  18. verz = AppFolder.ParentFolder.ParseName(AppFolder.Title).Path
  19. If Err.Number > 0 Then
  20.    i = InStr(AppFolder, ":")
  21.    verz = Mid(AppFolder, i - 1, 1) & ":\"
  22. End If
  23. If verz = "" Then Exit Sub
  24. StartFolder = verz
  25.  
  26. Set drive = MyFiles.GetFolder(verz)
  27. Set dat = drive.Files
  28. For Each datei In dat
  29.     n = n + 1
  30.     dname(n) = datei.Name
  31.     dordner(n) = drive.Path
  32.     dpfad(n) = datei.Path
  33.     dsize(n) = datei.Size
  34.     dcreated(n) = datei.datecreated
  35.     dlast(n) = datei.DateLastAccessed
  36.     dtyp(n) = datei.Type
  37. Next
  38.  
  39. Search drive
  40.  
  41. Documents.Add DocumentType:=wdNewBlankDocument
  42. Selection.WholeStory
  43. Selection.ParagraphFormat.TabStops.ClearAll
  44. Selection.ParagraphFormat.TabStops.Add Position:=CentimetersToPoints(4), _
  45.    Alignment:=wdAlignTabLeft, Leader:=wdTabLeaderSpaces
  46.  
  47. Selection.TypeText "Slo₧ka " & StartFolder
  48. Selection.TypeParagraph
  49. Selection.TypeParagraph
  50.  
  51. For x = 1 To n
  52.     Selection.TypeText "JmΘno souboru:" & Chr(9) & dname(x)
  53.     Selection.TypeParagraph
  54.     Selection.TypeText "Slo₧ka:" & Chr(9) & dordner(x)
  55.     Selection.TypeParagraph
  56.     Selection.TypeText "Velikost:" & Chr(9) & dsize(x)
  57.     Selection.TypeParagraph
  58.     Selection.TypeText "Vytvo°en:" & Chr(9) & dcreated(x)
  59.     Selection.TypeParagraph
  60.     Selection.TypeText "Naposledy otev°en:" & Chr(9) & dlast(x)
  61.     Selection.TypeParagraph
  62.     Selection.TypeParagraph
  63. Next
  64. Selection.TypeParagraph
  65. Selection.TypeText n & " soubor∙ ve slo₧ce " & StartFolder
  66.  
  67. Application.ScreenUpdating = True
  68. m = MsgBox(n & " soubor∙ vypsßno." & Chr(13) & "Vytvo°it dalÜφ seznam soubor∙?", 4)
  69. If m = 6 Then Seznam_souboru
  70.  
  71. End Sub
  72.  
  73. Sub Search(ByVal StartFolder)
  74.     Set Weitere = StartFolder.SubFolders
  75.      For Each AktuellerOrdner In Weitere
  76.           Set dat = AktuellerOrdner.Files
  77.             For Each datei In dat
  78.                 n = n + 1
  79.                 dname(n) = datei.Name
  80.                 dordner(n) = AktuellerOrdner.Path
  81.                 dpfad(n) = datei.Path
  82.                 dsize(n) = datei.Size
  83.                 dcreated(n) = datei.datecreated
  84.                 dlast(n) = datei.DateLastAccessed
  85.                 dtyp(n) = datei.Type
  86.             Next
  87.         Search AktuellerOrdner
  88.      Next
  89. End Sub
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.