
List of files modified before a certain date
Hi Andrew,
Which line of code is highlighted when the error hits?
I have a suspicion that it is this one
.Add name:="Last Modified", _
Condition:=msoConditionAnytimeBetween, _
Value:="1/1/98", SecondValue:="6/30/98", _
Connector:=msoConnectorAnd
If so, then the most likely cause is that you are getting US and UK date
formats mixed up. Try setting SecondValue to "30/6/98"
--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email
Quote:
> Hi
> I am trying to search for files last changed before a certain date. The
> following example lifted from HELP should do approx what I want, but it
> doesnt compile - gives "Invalid procedure call or argument".
> Where am I (and the author of Help text!) going wrong.
> Thanks
> Public Sub t5()
> Dim fs As FileSearch
> Set fs = Application.FileSearch
> fs.NewSearch
> With fs.PropertyTests
> .Add name:="Files of Type", _
> Condition:=msoConditionFileTypeWordDocuments, _
> Connector:=msoConnectorOr
> .Add name:="Last Modified", _
> Condition:=msoConditionAnytimeBetween, _
> Value:="1/1/98", SecondValue:="6/30/98", _
> Connector:=msoConnectorAnd
> End With
> End Sub
> --
> Andrew Black