Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2007

Tip: Looking for answers? Try searching our database.

Equivalent of FileSearch in Access 2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carl Rapson - 28 Jun 2007 20:44 GMT
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
Allen Browne - 29 Jun 2007 02:57 GMT
For alternate code, see:
   List files recursively - List files in a folder and subfolders
at:
   http://allenbrowne.com/ser-59.html

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>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
[quoted text clipped - 15 lines]
> Access 2007 no longer has the FileSearch object, so is there another way
> to accomplish this?
Carl Rapson - 29 Jun 2007 15:57 GMT
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

> For alternate code, see:
>    List files recursively - List files in a folder and subfolders
[quoted text clipped - 20 lines]
>> Access 2007 no longer has the FileSearch object, so is there another way
>> to accomplish this?
Allen Browne - 30 Jun 2007 02:15 GMT
Perhaps someone else can provide an alternate suggestion if you need to
search for values within the file.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> 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
[quoted text clipped - 37 lines]
>>> Access 2007 no longer has the FileSearch object, so is there another way
>>> to accomplish this?
Peter YangMSFT] - 02 Jul 2007 06:54 GMT
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
Carl Rapson - 02 Jul 2007 17:44 GMT
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

> Hello Carl,
>
[quoted text clipped - 32 lines]
>
> http://support.microsoft.com/default.aspx?scid=fh;EN-US;OfferProPhone#faq607
Peter YangMSFT] - 03 Jul 2007 08:32 GMT
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.
Carl Rapson - 05 Jul 2007 15:55 GMT
Thanks once again, Peter, for the help and information. I appreciate the
links and will investigate the possibilities.

Carl Rapson

> Hello Carl,
>
[quoted text clipped - 47 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Peter YangMSFT] - 06 Jul 2007 08:39 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.