Find pdf files which contain a specific word

dim

Registered User.
Local time
Today, 00:39
Joined
Jul 20, 2012
Messages
54
Hi,


I’m not a programmer, but I did a lot of research and I don’t found what I need.
I hope that You can help me!

This is what I need:
I have more pdf searchable, all located in the same folder location. (Ex: C:\Temp)
From an Access form, I like to find all the pdf files located in that folder, which contain a specific predefined word.

For example I have a “form_A”, with a field [wf] where the user will tape the word to find (ex: lumber). After the user will press on a “Search Button” all the pdf files which contain the searched word “lumber”, I need to appear on the form as a list with their file names.
In the second step, the user will select a specific file from that list, and after the pdf will open, the searched word lumber, I need to appear as highlighted.

Thank You!
 
Use the Windows search function in windows explorer. Trying to achieve this via Access is not trivial!
 
Hi,

Thank You, but the folder where are all the files is on the LAN.
The second reason is because I need to integrate this search tool with another Access application and this way will be more friendlily for all the users.
 
Any wildcard file search on a LAN location you do will take a considerable time, if you add Access into the equation it will take even longer, and then displaying the results in a sensible fashion will not be easy if there are hundreds of hits.

Then you have to open the file and perform the highlight. I'm sure it's possible if you can guarantee the version of acrobat being used on everyone's' machine but if not you have a secondary whole world of pain!
 
I know that I can use a dedicated search software as "Copernic" which will index all the files and then is fast to use it, but I have to install it on each machine. That why I'm lucking for a better way to do it.....
 
Minty's comments are absolutely appropriate to this problem. Let me explain this in another way so you will understand what is going on here.

Doing this in Access IS possible, but has pitfalls. In limited detail, here is what you would need to do.

  • Determine the version of Adobe on your user systems. If this is NOT uniform, you are no better off than having to install some dedicated search program on every user's system.
  • Establish code references (from a VBA page) using Tools >> References to point to the Adobe libraries that will allow some limited functions.
  • Use the File System Object to identify/locate the .PDF files in the required folder. (This could come back from the FSO search as a collection).
  • This implies that you have to know how to elaborate through the list of items in a collection.
  • Open an Adobe Application Object, then use the exposed methods thereof to open the next identified file for searching.
  • Use the exposed methods on the now-open document to actually perform the search. Note that this search will probably just find the first use of that particular word/string, but that's OK. If you find even one match in the file, it would have qualified using any other search anyway.
  • Take the results of the search (i.e. found string or did not find string) and do whatever it was you were going to do with that information.
  • Don't forget when the search is done to close the .PDF file you just searched, whether the result was match, no match, or blew up in your face.
  • After examing the last file in the FSO collection, don't forget to close the Adobe and FSO objects and then de-reference them.

When Minty suggested this would not be a trivial operation, he wasn't kidding.

Pitfalls? You have to hope that every user has the same versions of Access and Adobe Reader (or Acrobat or whatever other product is involved here). Otherwise, you have to program for the lowest common denominator. Further, if there is a chance that some users don't have Access and Adobe installed, you have to fix that.
 

Users who are viewing this thread

Back
Top Bottom