Dates with FileSearch Object

B

Ben

Greetings!

I am trying to use the FileSearch object to search through
folders for any file grater than the date 01/01/2004.
However, the closest thing to specifying a date is the
property .LastModified, which only accepts a handfull of
constants. Is there any way to use an actual date for this?
Sample code:

With Application.FileSearch
.NewSearch
.LookIn = "C:\"
.FileType = 1
.TextOrProperty = "*Test*"
.LastModified = msoLastModifiedYesterday
.Execute

If .Execute() > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
Else
MsgBox "There were no files found."
End If
End With

I want to change the .LastModified property to look
something like this:
.LastModified > "#01/01/2004#"

Is there another way?

Thanks,
The Ben
 

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