K
Kevin
I have just reinstalled my development tools (Visual Studio .net and VS for
Office 2003) and my code for FileSearch is no longer finding files. The code
is as follows
Dim fs As FileSearch
Dim strFile As String
' Declare filesearch object.
Set fs = Application.FileSearch
With fs
.NewSearch
.SearchSubFolders = False
' Set folder to search.
.LookIn = strDir
' Set file name to search for.
.FileName = "*.*"
lngCount = 0
' Execute the file search, and check to see if the file(s) are
' present.
If .Execute > 0 Then
Me.lstFiles.Value = ""
' Loop through all found file names and fill the list box.
For intLoop = 1 To .FoundFiles.Count
strFile = .FoundFiles(intLoop)
strFile = Check_If_PDF(strFile)
If strFile = "" Then
Else
Me.lstFiles.AddItem strFile
lngCount = lngCount + 1
End If
Next intLoop
End If
End With
When I run this code on another machine it works fine. The above code is a
standard I use on Access and Excel and whilst the folders I am searching
contain files that should be returned, the code says there is nothing.
Any ideas or is this a new bug.
Office 2003) and my code for FileSearch is no longer finding files. The code
is as follows
Dim fs As FileSearch
Dim strFile As String
' Declare filesearch object.
Set fs = Application.FileSearch
With fs
.NewSearch
.SearchSubFolders = False
' Set folder to search.
.LookIn = strDir
' Set file name to search for.
.FileName = "*.*"
lngCount = 0
' Execute the file search, and check to see if the file(s) are
' present.
If .Execute > 0 Then
Me.lstFiles.Value = ""
' Loop through all found file names and fill the list box.
For intLoop = 1 To .FoundFiles.Count
strFile = .FoundFiles(intLoop)
strFile = Check_If_PDF(strFile)
If strFile = "" Then
Else
Me.lstFiles.AddItem strFile
lngCount = lngCount + 1
End If
Next intLoop
End If
End With
When I run this code on another machine it works fine. The above code is a
standard I use on Access and Excel and whilst the folders I am searching
contain files that should be returned, the code says there is nothing.
Any ideas or is this a new bug.