Searching files

  • Thread starter Thread starter Paradigm
  • Start date Start date
P

Paradigm

Does anyone know of an ocx or dll that I can use in Access 2K to search
files for text string. Ideally I would like to search doc, xls, pdf files.
Alec
 
Paradigm said:
Does anyone know of an ocx or dll that I can use in Access 2K to search
files for text string. Ideally I would like to search doc, xls, pdf files.

The following should work on any Office files, but I don't think it will
find anything in a PDF. Most PDF viewers have their own search capabilities.

Function TextSearch()
' Search for text in a file
' Note: Must set a reference to Microsoft Office 8.0 Object Library
Dim q As Long
With Application.FileSearch
.NewSearch
.LookIn = "C:\" 'Path
.SearchSubFolders = True
.FileName = "*.*"
.TextOrProperty = "Word1 Word2 Word3 Word4" 'Search words
If .Execute() > 0 Then
For q = 1 To .FoundFiles.Count
MsgBox .FoundFiles(q)
Next
End If
End With
End Function
 
Thanks Arvin that's very usefull
Alec

Arvin Meyer said:
files.

The following should work on any Office files, but I don't think it will
find anything in a PDF. Most PDF viewers have their own search capabilities.

Function TextSearch()
' Search for text in a file
' Note: Must set a reference to Microsoft Office 8.0 Object Library
Dim q As Long
With Application.FileSearch
.NewSearch
.LookIn = "C:\" 'Path
.SearchSubFolders = True
.FileName = "*.*"
.TextOrProperty = "Word1 Word2 Word3 Word4" 'Search words
If .Execute() > 0 Then
For q = 1 To .FoundFiles.Count
MsgBox .FoundFiles(q)
Next
End If
End With
End Function
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
Do you know what file types the filesearch will search? It seems to work
with all Office files but also some unexpected files such as Pagemaker. It
does not search pdf files which is a problem for me. I would like to provide
a list of all the file types that it works with and have been searching the
net but cannot find anything.
Alec
 
Do you know what file types can be searched. It seems to search all Office
files and some unexpected ones like Pagemaker. It does not search pdf files
which is a problem for me. I would like to produce a list of all file types
that can be searched.
Alec
 

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

Back
Top