Finding common words in documents as part of database

  • Thread starter Thread starter nmh
  • Start date Start date
N

nmh

I have an Access 2007 database with a number of clients. I also have their
resumes in both .doc and pdf formats. I would like to be able to type in a
word, i.e. technology, and if that word appears in any resumes, the name of
the person(s) who owns that resume would appear. Simply a type of name search
with criteria.

Is that possible to do with Access. If so, how would I approach this topic.
Any help and assistance would be greatly appreciated. Thanks.

Norm.
 
Here's some code that may help:

Function SearchText()
' Search for text in a file
' Note: Must set a reference to Microsoft Office Object Library
Dim q As Long
With Application.FileSearch
.NewSearch
.LookIn = "D:\" 'Path
.SearchSubFolders = True
.FileName = "*.txt"
.TextOrProperty = "Arvin"
If .Execute() > 0 Then
For q = 1 To .FoundFiles.Count
Debug.Print .FoundFiles(q)
Next
End If
End With
End Function
 
Cool option! I tested it on pdf files but that doens't work. Is that
correct?

Lars
 
Many thanks Arvin. I shall give it a go. I would think that it would only
work in txt or doc files and not pdf. I have quite a few of them as doc
files.

Norm.
 
Lots of PDFs are not searchable, or only searchable with their own built-in
utility.

Did you remember to change:

.FileName = "*.txt"

to:

.FileName = "*.pdf"
 
As I mentioned in my other reply, Lots of PDFs are not searchable, or only
searchable with their own built-in utility. It will find .doc file text You
can also only search for 1 filetype at a time, and you must change:

.FileName = "*.txt"

to the file extension you want.
 
Yes, I did change the extension to pdf. I had one pdf file in the folder
which was not searchable for the application.filesearch. However, this pdf
file ís searchable for the windows explorer (XP) search option.

Lars
 
Arvin Meyer MVP said:
Here's some code that may help:

Function SearchText()
' Search for text in a file
' Note: Must set a reference to Microsoft Office Object Library
Dim q As Long
With Application.FileSearch
.NewSearch
.LookIn = "D:\" 'Path
.SearchSubFolders = True
.FileName = "*.txt"
.TextOrProperty = "Arvin"
If .Execute() > 0 Then
For q = 1 To .FoundFiles.Count
Debug.Print .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
 
Back
Top