Searching Word docs for strings

L

Les Juby

Can anyone please help with some VBScripting that would enable me to
search thru Word documents (Word 2000 format) and return the filenames
to use in a archive search on a legal website.?

TIA

.les.

o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
Les Juby (e-mail address removed)
Webpro Internet - - - Prosoft Microsystems
Durban, KwaZulu-Natal, South Africa
P.O.Box 35243, Northway 4065, South Africa
Tel: +27 31 563-8344 Fax: +27 31 564-4928
o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
(you *do* know to take "anti-spam" out the address....?
 
S

Steven Burn

<%
iCount = 0

Dim FSO, Fldr, Fl
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Fldr = FSO.GetFolder(Server.MapPath("./")) '// Current folder
For Each Fl In Fldr.Files
Response.Write Fl & "<br />"
iCount = iCount + 1
Next
Response.Write "<br /><b>There were " & iCount & " files found</b>"

Set FSO = Nothing
Set Fldr = Nothing
Set Fl = Nothing
%>

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
S

Steven Burn

Forgot to mention. To filter it for certain file type's, you could just
change;

For Each Fl In Fldr.Files
Response.Write Fl & "<br />"
iCount = iCount + 1
Next

to

For Each Fl In Fldr.Files
If right(fl.name, 3) = "doc" Then
Response.Write Fl & "<br />"
iCount = iCount + 1
End If
Next

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
A

Alan Howard

Les,

If you're searching content *in* the documents then you want to use Indexing
Service. This involves setting up a catalog which you can then link to from
SQL Server. The content of the catalog can then be queried using SELECT *
FROM (OPENQUERY (...)) syntax. There is some good information in BOL about
this.

Alan
 

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

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top