Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search functions

Status
Not open for further replies.

jedel

Programmer
Jan 11, 2003
430
0
0
AU
Hi,

My work PC use Office 2003. I'm looking for a feature where I can use MS Office to search for text in multiple files and produce a result for people to go to the file and read.

I'm sure, as always, that this forum would have the expertise to point me in the right direction or assist me in setting something up.

This is new territory for me so please, treat me like a beginner here.

Cheers

Dean

-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
 
So, you're wanting to Open a specific Office application, and then from the particular open document/file, search text from other files? Maybe with a preview of the text containing the searches? I think Windows Search does this already, but you'd use Windows Search instead of an Office doc to search.

Also, another alternative altogether, I think, is the freeware search program called SearchMyFiles. You can specify any amount of detail for your search critiera..

Or if none of that seems to give you what you want, perhaps you can give more detail as to what you want to be able to do.... or maybe a real-use scenerio?

--

"If to err is human, then I must be some kind of human!" -Me
 
The search feature on the start menu should work for you, or does it need to be automated?

All I ask is a chance to prove that money can’t make me happy.
 
Or, as you are using 2003, you could use FileSearch. Here is an example:
Code:
Sub FindingStuff()
Dim i As Long
Dim msg As String

With Application.FileSearch
    .NewSearch
    .LookIn = "C:\zzz"
    .SearchSubFolders = True
    .TextOrProperty = "fox"
    .MatchTextExactly = True
    .FileType = msoFileTypeAllFiles
        If .Execute() > 0 Then
            msg = "There were " & .FoundFiles.Count & _
               " file(s) found." & vbCrLf
            For i = 1 To .FoundFiles.Count
                msg = msg & .FoundFiles(i) & vbCrLf
            Next i
            MsgBox msg
         Else
            MsgBox "There were no files found."
         End If
End With
End Sub
In a search of 17 folders and sub-folders containing a 1731 files, 51 files were found containing the word "fox". (All as "The quick brown fox etc.") The msgbox displays the counting and a listing of the found files (path and filename). It took 7 seconds.

Note that you can not do this with Office 2007 apps, as Microsoft in its wisdom decided we did not need this functionality and removed FileSearch.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top