Results 1 to 2 of 2

Thread: FIND FILES

  1. #1
    New Lounger
    Join Date
    Jan 2001
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    FIND FILES

    I need to find Word docs containing specific phrases and if possible print all paragraphs/files found.

    A partial solution would be the ability to print the list of found files in the Tools:Find box.

    Any ideas?

    Thanks

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: FIND FILES

    It's possible to do this with VBA, using the FileSearch object. Here's an excerpt from the VBA Help text, to give you an idea:

    "This example searches the C:My Documents folder and all of its subfolders and returns all files whose body text or file properties contain any words that begin with "San." The TextOrProperty property sets the word to be searched for and limits the search to either the body of the file or the file properties.
    <pre>With Application.FileSearch
    .NewSearch
    .LookIn = "C:My Documents"
    .SearchSubFolders = True
    .TextOrProperty = "San*"
    .FileType = msoFileTypeAllFiles
    End With</pre>

    "This example steps through the list of found files and displays the path for each file.

    <pre>With Application.FileSearch
    For i = 1 To .FoundFiles.Count
    MsgBox .FoundFiles(i)
    Next I
    End With</pre>

    Hope this helps,
    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •