CROSSPOST: FileSearch Command Fails under Windows XP

P

Paul M. Eldridge

I've posted the following message under
microsoft.public.office.developer.vba and haven't yet received a
reply. I'm posting a copy under this forum, in the hope that someone
here may be able to help me. My apologies to those who frequent both
forums.

I'm in a bit of a panic, as I have a client with 400 workstations that
is about to upgrade to Office XP and I've written a half dozen or so
corporate-wide applications that utilize this code; all of these
applications are now broken and they are anxiously awaiting a fix.

Any advice/direction would be most appreciated.

Paul


---Original Post ---

Greetings All,

The FileSearch routine I use under Word 2000 to get a list of
documents is not working under Word XP (SP2). Has anyone else
encountered this problem?

The code in question is as follows (taken almost verbatim from the
online help):

Set fs = Application.FileSearch
With fs
.LookIn = "C:\DATA"
.FileName = "*.*"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
Else
MsgBox "There were no files found."
End If
End With

Under Word 2000, VBA reports the correct number of files; under Word
XP, VBA returns 0 files. I've tried removing the SortBy and SortOrder
qualifiers, but this does not alter the results. The operating system
is Windows XP, Home Edition, SP1.

Any assistance would be greatly appreciated.

Paul
 

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