List of files modified before a certain date 
Author Message
 List of files modified before a certain date

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



Thu, 13 Mar 2003 10:20:14 GMT  
 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



Thu, 13 Mar 2003 03:00:00 GMT  
 List of files modified before a certain date
Thanks Jonathan

You are correct that this is the line of code that is failing.    
There is something{*filter*}y going on - I have office 2000 without SR1, maybe
I need to install that before proceeding further.   In more detail

 - my saved version has the line
        Value:="1/1/70", SecondValue:="9/1/00", _
   When I ran it after starting Word it went through listing files as I  
   wanted

 - I changed another module as part of something else and lo
   the "Invalid procedure call or argument started.


says...

Quote:
> 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"



Wed, 19 Mar 2003 03:00:00 GMT  
 List of files modified before a certain date

Hi Andrew,

Try using 4-digit years in the dates.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.*-*-*.com/
Word FAQs at http://www.*-*-*.com/
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email


Quote:
> Thanks Jonathan

> You are correct that this is the line of code that is failing.
> There is something{*filter*}y going on - I have office 2000 without SR1, maybe
> I need to install that before proceeding further.   In more detail

>  - my saved version has the line
>         Value:="1/1/70", SecondValue:="9/1/00", _
>    When I ran it after starting Word it went through listing files as I
>    wanted

>  - I changed another module as part of something else and lo
>    the "Invalid procedure call or argument started.


> says...
> > 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"



Thu, 20 Mar 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. procedure to find certain files from a certain date on harddisk

2. File Creat Date and Modified Date...

3. List Access Objects based on Date Last Modified

4. modify date file (file properties)

5. Limit FileSearch to Files of certain date?

6. Find files updated after certain date in a folder

7. API calls to search for files between certain dates

8. List of users, using certain file

9. Modifying the Last Modified Date and Time

10. Date Modified of a File

11. Read file Date/Time last modified

12. Files modified date

 

 
Powered by phpBB® Forum Software