File Search w/ VBA

T

Tom Gwinn

I am running Access 2003 on Windows XP. I am trying to determine through
code if a file exists in the Windows directory on the local hard drive. The
code below is what I am using. Unfortunately this doesn't seem to work for
me. I would appreciate any help on this. Thanks!

With Application.FileSearch
.LookIn = "C:\WINDOWS"
.SearchSubFolders = True
.FileName = "test.txt" '"201DS.txt"
If .Execute() > 0 Then
MsgBox "File found"
Else
MsgBox "No File"
End If
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top