View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Hub van de Laar Hub van de Laar is offline
external usenet poster
 
Posts: 5
Default FileSearch dislikes Zip-files

L.S.

FileSearch doesn't report zip-files. Executing the Macro
you'll find below, does not list the zip-files that reside
in the specified directory. Replacing the FileName "*.zip"
by "*.*" lists all files except the zip-files.

I've reviewed the contents of the collections
PropertyTests and FileTypes, but could not get any results.

Using the interactive version at the Excel-sheet, via the
menu-options, I got the same results.

Kind regards,
Hub van de Laar



Private Sub ListZipFiles()
Dim FS As FileSearch, I As Integer
With Application.FileSearch
.NewSearch
.LookIn = "D:\"
.FileType = msoFileTypeAllFiles
.Filename = "*.zip"
.SearchSubFolders = True
If .Execute 0 Then
For I = 1 To .FoundFiles.Count
Debug.Print .FoundFiles(I)
Next I
Else
MsgBox "No Zip-files found."
End If
End With
End Sub