How to make a filesearch sorted on last modified files

B

Björn

I try the following, but when sorting on LastModified it
always sorts ascending on filename. This is what i try:

With Application.FileSearch
.NewSearch
.LookIn = testpath
.SearchSubFolders = True
.FileName = *.doc"
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
.LastModified = msoLastModifiedAnyTime
End With

With Application.FileSearch

If .Execute(SortBy:=msoSortByLastModified, _
SortOrder:=msoSortOrderDescending) <> 0 Then
..
..
..
Exactly the same reults when using Ascending
/Björn
 
W

Word Heretic

G'day "Björn" <[email protected]>,

preload all the valid results into an array and wodbasic.sortarray the
sucker yourself

Björn said:
I try the following, but when sorting on LastModified it
always sorts ascending on filename. This is what i try:

With Application.FileSearch
.NewSearch
.LookIn = testpath
.SearchSubFolders = True
.FileName = *.doc"
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
.LastModified = msoLastModifiedAnyTime
End With

With Application.FileSearch

If .Execute(SortBy:=msoSortByLastModified, _
SortOrder:=msoSortOrderDescending) <> 0 Then
.
.
.
Exactly the same reults when using Ascending
/Björn

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email (e-mail address removed)
Products http://www.geocities.com/word_heretic/products.html

Replies offlist may require payment.
 

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