From: MLH on
With Application.FileSearch
.NewSearch
.LookIn = "C:\My Documents"
.SearchSubFolders = True
.FileName = "Run"
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
End With

My code pukes complaining that msoFileTypeAllFiles
is an undefined var type. Isn't it s'posed to be some
kind of intrinsic constant or something? How can I
make this little snippet work for me?


From: MLH on
Oops... forgot to mention that I tried this...

Private Sub Command0_Click()
Dim i As Integer
With Application.FileSearch
.NewSearch
.LookIn = "C:\Docs\TitleWork\Customers"
.SearchSubFolders = True
.FileName = "*262*.*"
.MatchTextExactly = True
' .FileType = msoFileTypeAllFiles
End With
With Application.FileSearch
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
End With
End Sub

This did nothing at all for me. Rem'ing out the
..FileType assignment was perhaps a mistake???
The code runs but I get no MsgBoxes displaying
FoundFiles.

Help.
From: Salad on
MLH wrote:
> Oops... forgot to mention that I tried this...
>
> Private Sub Command0_Click()
> Dim i As Integer
> With Application.FileSearch
> .NewSearch
> .LookIn = "C:\Docs\TitleWork\Customers"
> .SearchSubFolders = True
> .FileName = "*262*.*"
> .MatchTextExactly = True
> ' .FileType = msoFileTypeAllFiles
> End With
> With Application.FileSearch
> For i = 1 To .FoundFiles.Count
> MsgBox .FoundFiles(i)
> Next i
> End With
> End Sub
>
> This did nothing at all for me. Rem'ing out the
> .FileType assignment was perhaps a mistake???
> The code runs but I get no MsgBoxes displaying
> FoundFiles.
>
> Help.

You could use the code at http://www.mvps.org/access/api/api0006.htm.
One thing it specified..."Before using the code, make sure "Microsoft
Office 8.0 Object Library" (typically referenced to MSO97.DLL under
Office folder) is selected under Tools/References". This is not the
Access library but the Office Object library.

Teardrop
http://youtube.com/watch?v=fG8eQBSp9Ao
From: MLH on
Thanks, Salad. I think that'll work for me.