The file search object does not work properly on all platforms. This is a
known issue but the workarounds provided in article 305342 do not resolve the
problem when using a local hard drive mapped to “K:”. I need
recommendations for returning the most recent file in a subdirectory with out
using the FileSearch object.
The following code works as expected except when using Office XP with
Windows 2000.
------------------------------------------------------------------------------
With Application.FileSearch
..Newsearch
..Lookin = “K:\”
..SearchSubFolders = false
NumFound = .Execute(SortBy: msoSortByLastModified, _
SortOrder: = msoSortOrderDescending _
AlwaysAccurate = True)
If NumFound >0 then NewestFile = FilesFound(1)
-------------------------------------------------------------------------------
I need code that works on any combination of Office 2000 and above with
Window 2000 and above. The code above is generic and I will actually be
using a function.
Thanks
Bookmarks