Query for string within an embedded OLE object

T

td

We have a database which contains records with data for various legal
filings. One of the fields for each record is an actual embedded Word
document of the legal filing for that record.

We would like to be able to do queries for terms within those Word files. I
know I can just put all of these files in a folder and do a Search through
Windows, but we'd like (1) not to have to replicate storage of these files,
and (2) have all of our queries able to be executed from a central location.

I've done some test runs where I search for strings in the OLE Object field
that contains the Word documents using expressions such as

Like "*right of first refusal*"

but I got zero results, even though I know that string was in some of the
documents.

Any help is appreciated.

Thanks
TD
 
K

KARL DEWEY

What about using hyperlinks instead of the OLE objects? I just tried and it
pulls the record. You can then click on the hyperlink and open the document.

If you want to build your hyperlink list try this --

You can create a text file of your Word documents to import.

Click on windows START - Run and type in CMD. This brings up a DOS window.
It will default to C:\Documents and Settings\Your User Name.
Use the command CD\ and press ENTER to get to the root directory if
you files are on the C:drive. If they are on another drive then type in the
drive letter followed by a colon like this F: and then press ENTER.
Then CD and the folder name where the files are located. You will need to
tranverse one folder layer at a time.

Then use the command DIR to see the file listing. Then use the command
DIR /B >MyFileList.TXT to create the text file containing all files in
that directory. The /B only list the filenames with extention. If you
want size and other information omit it. If you also have files in
subdirectories the you can get them all by including a switch for
subdirectories like this --
DIR /S /B >MyFileList.TXT
When you finish close the DOS window. Open in Excel.
Build your hyperlinks by editing the Excel.
Import the text file.
 
T

td

Thanks Karl.

That is actually similar to an option I considered. In this case we could
still have easy access to the file through the link in the database, but
search for keywords using Windows search function. Problem is, we may have
some complex queries to execute, and as far as I can tell, Windows search
will not let me do that. For instance, it won't let me even do simple
searches for document containing one term and another term. We really need
that capability.

We may have to find another strategy, but if anyone knows a way to get query
functionality to work for an embedded Word document, that would be best.
 
K

KARL DEWEY

Either you misunderstood me or I do not get what you are trying to do.

If you use a criteria on a hyperlink field it will search the linked
document.

If this is your criteria ---
Like "*right of first refusal*"
It will pull the record that has a linked document with this phrase. Is
this not what you want to do?
 
T

td

yes, I misundersood. I thought when you said "pulled the record" you just
meant it opened the document when you used the link. Anyway, thanks, that
will definitely work if it does as you say.
 
T

td

I tried this using a link, but still doesn't work. You indicated that you
*did* get it to look in the file to which the hyperlink pointed, right? I
wonder what I'm doing differently.

I have a simple table (just to test this out). I put four Word files in a
folder, and put hyperlinks to them in a hyperlink column. Then I executed a
query for a word that I know was in the documents pointed to by the
hyperlinks, but there were no hits.

Any idea what Im doing differently?
TD
 
K

KARL DEWEY

Oops!

I used criteria that was a match in the filename. Using criteria not in
filename or hyperlink label did not pull anything.

Sorry for the trouble I put you through.
 

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

Top