Word: Filter files on date last modified 
Author Message
 Word: Filter files on date last modified

Help!
I'm trying to filter from FileSearch, documents modified before a certain
date.
I have tried to use the following after opening the document:

myTimeLastSaved =
ActiveDocument.BuiltInDocumentProperties(wdPropertyTimeLastSaved)

but this causes an automation error.
Is there another document property that stores the date last modified, and
if there is, what format is it in?

Thanks in anticipation,
Kieran Walsh
York, England



Wed, 23 Oct 2002 03:00:00 GMT  
 Word: Filter files on date last modified
Hi Kieran,

The only way I could reproduce the error was to run the code in a not yet
saved document. As long as the document has been saved, the code runs fine
here. Is that not what you are experiencing? If this is the case, is there
something special at the document that generates the error?

Hope this helps,
regards,
Astrid (Microsoft Word MVP)

For direct access to all Microsoft newsgroups:



Quote:
> Help!
> I'm trying to filter from FileSearch, documents modified before a certain
> date.
> I have tried to use the following after opening the document:

> myTimeLastSaved =
> ActiveDocument.BuiltInDocumentProperties(wdPropertyTimeLastSaved)

> but this causes an automation error.
> Is there another document property that stores the date last modified, and
> if there is, what format is it in?

> Thanks in anticipation,
> Kieran Walsh
> York, England



Thu, 24 Oct 2002 03:00:00 GMT  
 Word: Filter files on date last modified
Hello Astrid,
The document I'm processing is in text format, perhaps this is a problem,
but looking at the Properties when open in Word, the last modified date does
have a value.
The exact error I get is:  Run-Time error '-2147467259(80004005)'
Automation error Thanks for your help.
Kieran


Quote:
> Hi Kieran,

> The only way I could reproduce the error was to run the code in a not yet
> saved document. As long as the document has been saved, the code runs fine
> here. Is that not what you are experiencing? If this is the case, is there
> something special at the document that generates the error?

> Hope this helps,
> regards,
> Astrid (Microsoft Word MVP)

> For direct access to all Microsoft newsgroups:



> > Help!
> > I'm trying to filter from FileSearch, documents modified before a
certain
> > date.
> > I have tried to use the following after opening the document:

> > myTimeLastSaved =
> > ActiveDocument.BuiltInDocumentProperties(wdPropertyTimeLastSaved)

> > but this causes an automation error.
> > Is there another document property that stores the date last modified,
and
> > if there is, what format is it in?

> > Thanks in anticipation,
> > Kieran Walsh
> > York, England



Thu, 24 Oct 2002 03:00:00 GMT  
 Word: Filter files on date last modified
Hi Kieran,

You can use:

myTimeLastSaved = FileDateTime(ActiveDocument.FullName)

or you can do this directly in the FileSearch code - look up the
"PropertyTests collection object" in Word VBA Help - it has an example.

--
Hope this helps.
Regards
ibby

Please post replies or follow-ups to the **newsgroup** so that participants
may benefit or contribute.

Quote:
> Hello Astrid,
> The document I'm processing is in text format, perhaps this is a problem,
> but looking at the Properties when open in Word, the last modified date
does
> have a value.
> The exact error I get is:  Run-Time error '-2147467259(80004005)'
> Automation error Thanks for your help.
> Kieran



> > Hi Kieran,

> > The only way I could reproduce the error was to run the code in a not
yet
> > saved document. As long as the document has been saved, the code runs
fine
> > here. Is that not what you are experiencing? If this is the case, is
there
> > something special at the document that generates the error?

> > Hope this helps,
> > regards,
> > Astrid (Microsoft Word MVP)

> > For direct access to all Microsoft newsgroups:



> > > Help!
> > > I'm trying to filter from FileSearch, documents modified before a
> certain
> > > date.
> > > I have tried to use the following after opening the document:

> > > myTimeLastSaved =
> > > ActiveDocument.BuiltInDocumentProperties(wdPropertyTimeLastSaved)

> > > but this causes an automation error.
> > > Is there another document property that stores the date last modified,
> and
> > > if there is, what format is it in?

> > > Thanks in anticipation,
> > > Kieran Walsh
> > > York, England



Sat, 26 Oct 2002 03:00:00 GMT  
 Word: Filter files on date last modified
Thanks, Ibby
Both methods were good, with the PropertyTest solution more speedy.
Kieran


Quote:
> Hi Kieran,

> You can use:

> myTimeLastSaved = FileDateTime(ActiveDocument.FullName)

> or you can do this directly in the FileSearch code - look up the
> "PropertyTests collection object" in Word VBA Help - it has an example.

> --
> Hope this helps.
> Regards
> ibby

> Please post replies or follow-ups to the **newsgroup** so that
participants
> may benefit or contribute.


> > Hello Astrid,
> > The document I'm processing is in text format, perhaps this is a
problem,
> > but looking at the Properties when open in Word, the last modified date
> does
> > have a value.
> > The exact error I get is:  Run-Time error '-2147467259(80004005)'
> > Automation error Thanks for your help.
> > Kieran



> > > Hi Kieran,

> > > The only way I could reproduce the error was to run the code in a not
> yet
> > > saved document. As long as the document has been saved, the code runs
> fine
> > > here. Is that not what you are experiencing? If this is the case, is
> there
> > > something special at the document that generates the error?

> > > Hope this helps,
> > > regards,
> > > Astrid (Microsoft Word MVP)

> > > For direct access to all Microsoft newsgroups:



> > > > Help!
> > > > I'm trying to filter from FileSearch, documents modified before a
> > certain
> > > > date.
> > > > I have tried to use the following after opening the document:

> > > > myTimeLastSaved =
> > > > ActiveDocument.BuiltInDocumentProperties(wdPropertyTimeLastSaved)

> > > > but this causes an automation error.
> > > > Is there another document property that stores the date last
modified,
> > and
> > > > if there is, what format is it in?

> > > > Thanks in anticipation,
> > > > Kieran Walsh
> > > > York, England



Sat, 26 Oct 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Change the Last Modify and Last Access date

2. Modifying the Last Modified Date and Time

3. Read file Date/Time last modified

4. Check the last modified date on any file

5. Determine file last modified date.

6. Need to display last modified date for files in web page

7. script to update a file's last modified date

8. File's last modified date?

9. File Last Modified Date

10. How to get the last modified date of a file

11. Modules and date last modified

12. How to look for Last Modified Date...

 

 
Powered by phpBB® Forum Software