Z
zkid
I use the following code to fetch a list of files from a particular folder
(it actually loads an array, but I've simplied the code for this purpose):
Dim iCount as integer, i as integer
With Application.FileSearch
.NewSearch
.LookIn = [the folder path]
.SearchSubFolders = False
.FileName = "*.doc"
.MatchTextExactly = False
.FileType = msoFileTypeAllFiles
If .Execute() Then
iCount = .FoundFiles.Count
If iCount = 0 Then
Exit Sub
End If
For i = 1 To iCount
Msgbox .FoundFiles(i)
Next i
Else
Exit Sub
End If
End With
This code works flawlessly in versions lower than Word 2003. However, for
some bizarre reason, if I create a new file in the "lookin" folder, 2003
doesn't always see it for at least 15 minutes. Has anyone else had this
problem?
Thanks.
(it actually loads an array, but I've simplied the code for this purpose):
Dim iCount as integer, i as integer
With Application.FileSearch
.NewSearch
.LookIn = [the folder path]
.SearchSubFolders = False
.FileName = "*.doc"
.MatchTextExactly = False
.FileType = msoFileTypeAllFiles
If .Execute() Then
iCount = .FoundFiles.Count
If iCount = 0 Then
Exit Sub
End If
For i = 1 To iCount
Msgbox .FoundFiles(i)
Next i
Else
Exit Sub
End If
End With
This code works flawlessly in versions lower than Word 2003. However, for
some bizarre reason, if I create a new file in the "lookin" folder, 2003
doesn't always see it for at least 15 minutes. Has anyone else had this
problem?
Thanks.