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.

I encountered some problems using the FileSearch object.
Using the Macro you'll find below, it doesn'list the zip-
files that reside in the specified directory. When
replacing the Filename "*.zip" by "*.*", it lists all
files except the zip-files.

I've already reviewed the contents of the collections
PropertyTests and FileTypes, but had no results.

Using the interactive FileSearch from the Excel-sheet via
the menu-option provides the same results.


Private Sub CheckAllZipFiles()
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 files found."
End If
End With
End Sub