Equivalent of FileSearch in Access 2007

C

Carl Rapson

I have an Access 2002 application that uses the FileSearch object to search
the Excel files within a folder for a given text string. Something like
this:

With FileSearch
.LookIn = ActiveWorkOrderPath
.FileType = msoFileTypeExcelWorkbooks
.MatchTextExactly = False
.TextOrProperty = Me.txtSearch.Value
.Execute
If .FoundFiles.Count > 0 Then
For FileCount = 1 To .FoundFiles.Count
' process .FoundFiles.Item(FileCount)
Next FileCount
End If
End With

Access 2007 no longer has the FileSearch object, so is there another way to
accomplish this?

Thanks,

Carl Rapson
 
C

Carl Rapson

Thanks Allen. Your code will help me to generate the list of files to be
searched, but what I am trying to do is search within the files themselves
for the specified text. There are Excel spreadsheets, and I'm looking for
each file that contains (within a cell) an occurrence of the text string.

From what I've read (I didn't create this application), the FileSearch
object is used to fetch a list of files based on the file name, but this
application seems to be using FileSearch to search within the files
themselves. At least, that's how it was working under Access 2002. The
search text that was entered exists within the files themselves, not in the
file names. So how was FileSearch able to return those files? And is there
anything else I can use to do the same thing?

Thanks again,

Carl Rapson
 
A

Allen Browne

Perhaps someone else can provide an alternate suggestion if you need to
search for values within the file.
 
P

Peter YangMSFT]

Hello Carl,

If you'd like to search content in a file, you may want to consider desktop
search feature:
http://www.microsoft.com/technet/scriptcenter/topics/desktop/wdsearch.mspx

More related information:

935402 Error message when you try to run the FileSearch function in Access
2007: "You entered an expression that has an invalid reference to the
property FileSearch"
http://support.microsoft.com/default.aspx?scid=kb;EN-US;935402

If you have any further comments or questions, please feel free to let's
know. Thank you.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=====================================================
Please note that the newsgroups are staffed weekdays with a goal to provide
ONE BUSINESS DAY RESPONSE to all posts.

If this response time does not meet your needs, please contact CSS for more
immediate assistance:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;OfferProPhone#faq607
 
C

Carl Rapson

Thanks, Peter. A couple of questions:

Am I right in thinking the FileSearch function was actually looking within
the files themselves? Most people seem to use it just for searching for file
names, and that's all the documentation seems to talk about.

Any explanation as to why Microsoft removed the FileSearch feature? It seems
like yet another unneeded change to Access 2007 (the major one being
removing the "Export to Excel" capability from reports).

I'll look at desktop search, but it's not a likely possibility because my
company is reluctant to support additional software (such as DLLs) that must
be installed on each machine; we prefer to use built-in functionality to
simplify support. And it's going to be quite a while before everyone has
Vista.

Thanks,

Carl Rapson
 
P

Peter YangMSFT]

Hello Carl,
Am I right in thinking the FileSearch function was actually looking within
the files themselves? Most people seem to use it just for searching for file
names, and that's all the documentation seems to talk about.


Yes. When TextOrProperty property is set, you could search file content via
FileSearch function.
Any explanation as to why Microsoft removed the FileSearch feature? It seems
like yet another unneeded change to Access 2007 (the major one being
removing the "Export to Excel" capability from reports).

This is a design change of Office 2007 and the feature is removed from
Office search spec at very beginning of product design. We are supposed to
dependent on OS search and/or new desktop search for replacement.


If you don't want to install Windows desktop search, you may want to
consider use Windows search/indexing service built in WinXP/Win2003. The
following are some related articles for your reference:


Windows search

http://msdn2.microsoft.com/en-us/library/aa163301.aspx

http://msdn2.microsoft.com/en-us/library/bb266517.aspx

820983 How to use an ASP.NET application to query an Indexing Service
catalog by using Visual C# .NET
http://support.microsoft.com/default.aspx?scid=kb;EN-US;820983

Please rest assured that your concerns and feedback on this design changes
are routed to the product team. If you have any further comments or
feedback, please also let's know. Thank you.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=====================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
C

Carl Rapson

Thanks once again, Peter, for the help and information. I appreciate the
links and will investigate the possibilities.

Carl Rapson

"Peter YangMSFT]" said:
Hello Carl,
Am I right in thinking the FileSearch function was actually looking within
the files themselves? Most people seem to use it just for searching for file
names, and that's all the documentation seems to talk about.


Yes. When TextOrProperty property is set, you could search file content
via
FileSearch function.
Any explanation as to why Microsoft removed the FileSearch feature? It seems
like yet another unneeded change to Access 2007 (the major one being
removing the "Export to Excel" capability from reports).

This is a design change of Office 2007 and the feature is removed from
Office search spec at very beginning of product design. We are supposed to
dependent on OS search and/or new desktop search for replacement.


If you don't want to install Windows desktop search, you may want to
consider use Windows search/indexing service built in WinXP/Win2003. The
following are some related articles for your reference:


Windows search

http://msdn2.microsoft.com/en-us/library/aa163301.aspx

http://msdn2.microsoft.com/en-us/library/bb266517.aspx

820983 How to use an ASP.NET application to query an Indexing Service
catalog by using Visual C# .NET
http://support.microsoft.com/default.aspx?scid=kb;EN-US;820983

Please rest assured that your concerns and feedback on this design changes
are routed to the product team. If you have any further comments or
feedback, please also let's know. Thank you.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=====================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.
 
P

Peter YangMSFT]

Hello Carl,

Thanks for your understanding. Your feedback on features /design changes is
always taken seriously and it shall help in future product enhancement.
Thanks.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=====================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Similar Threads


Top