Application.filesearch.execute

V

Vince Marconi

I'm having problems finding files other than .ppt using the
Application.filesearch.execute method. FileName has the correct path of the
file and extension, but when it gets to .Execute, it only displays the
powerpoint files. The powerpoint doesn't even have to match the filename to
be found in the Execute method.

I've converted this Access 97 database to Access 2002. The Execute method
works fine in 97, but it breaks when I use it in Access 2002. Any ideas or
comments would be appreciated!

Here's my code:

With Application.filesearch GCN = Forms!Main_Menu!hidden_gcn

..NewSearch

If Left(GCN, 1) = "A" Then
subdir = Left(GCN, 3)
.LookIn = "C:\TEMP\" & subdir
.FileName = GCN & ".cgm"
.SearchSubFolders = True
Lowercase = LCase(.FileName)
.MatchAllWordForms = True
.............

If .Execute() > 0 Then
i = .FoundFiles
.Count foundfile = .FoundFiles(i)
MyString = "C:\Program Files\Office2K\Office\Photodrw.exe " & foundfile
ShellString = Shell(MyString, 3)
Else
MsgBox "There were no files found."
End If
 
T

Tom Wickerath

Hi Vince,

It appears as if the problem might be in the line of code that reads:
.MatchAllWordForms = True

You have set a reference to the Microsoft Office Object Library, right? Are
you using different PC's for this test? The reason I ask is that I found the
following in the Access 2002 Help file:

***********
MatchAllWordForms Property
True if the file search is expanded to include all forms of the specified
word contained in the body of the file, or in the file's properties.
Read/write Boolean.

Remarks
This property is available only if the file Mswds_en.lex has been installed
and registered. Note that this file isn't installed as part of a Typical
setup.

***********

You may need to obtain a copy of the Mswds_en.lex file and/or use Regsvr32
to register it.

Tom
____________________________________

:

I'm having problems finding files other than .ppt using the
Application.filesearch.execute method. FileName has the correct path of the
file and extension, but when it gets to .Execute, it only displays the
powerpoint files. The powerpoint doesn't even have to match the filename to
be found in the Execute method.

I've converted this Access 97 database to Access 2002. The Execute method
works fine in 97, but it breaks when I use it in Access 2002. Any ideas or
comments would be appreciated!

Here's my code:

With Application.filesearch GCN = Forms!Main_Menu!hidden_gcn

..NewSearch

If Left(GCN, 1) = "A" Then
subdir = Left(GCN, 3)
.LookIn = "C:\TEMP\" & subdir
.FileName = GCN & ".cgm"
.SearchSubFolders = True
Lowercase = LCase(.FileName)
.MatchAllWordForms = True
.............

If .Execute() > 0 Then
i = .FoundFiles
.Count foundfile = .FoundFiles(i)
MyString = "C:\Program Files\Office2K\Office\Photodrw.exe " & foundfile
ShellString = Shell(MyString, 3)
Else
MsgBox "There were no files found."
End If
 

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