Kunz Berlin
06-17-2007, 12:49 PM
Hallo,
the results of Application.FileSearch are not complete. Who can help?
My program shall find all documents, that contain a certain keyword. It opens them one after another and copies all lines with that keyword (Selection.Find) into a new document. It searches in 8 folders with approx. 130 subfolders with altogether over 200 word-docs.
Closer description:
- not all docs, that contain the keyword, are found
- the incorrect result is exactly reproducible
- if you take the doc, that has incorrectly not been found, and type the keyword in a new line, it is found by the next search; but by using copy and paste, it is again not found.
- if by the new line the doc is found and then opened, Selection.Find finds both the old line and the new line.
- using a different keyword, which is also contained in the formerly not found doc, the doc is found.
- using the explorer-search > files and folders > text in the document the find list is complete
So it seems, as if on special lines there would lie a certain ?shadow?, by which some lines can not be recognized by Application.FileSearch. This ?shadow? remains by copy and paste.
(...)
With Application.FileSearch
.NewSearch
.LookIn = Searchpath(Modulgroup, 0)
.FileName = "*.doc"
.FileType = msoFileTypeAllFiles
.SearchSubFolders = True
.TextOrProperty = "*" + Searchtext(search) + "*"
End With
NumberFiles = Application.FileSearch.Execute()
If NumberFiles > 0 Then
For i = 1 To NumberFiles
DocFullName = Application.FileSearch.FoundFiles(i)
(...)
Next i
End If
(...)
For any kind of solution one to two million times THANKS in advance!
Greetings,
Kunz from Berlin, Germany
the results of Application.FileSearch are not complete. Who can help?
My program shall find all documents, that contain a certain keyword. It opens them one after another and copies all lines with that keyword (Selection.Find) into a new document. It searches in 8 folders with approx. 130 subfolders with altogether over 200 word-docs.
Closer description:
- not all docs, that contain the keyword, are found
- the incorrect result is exactly reproducible
- if you take the doc, that has incorrectly not been found, and type the keyword in a new line, it is found by the next search; but by using copy and paste, it is again not found.
- if by the new line the doc is found and then opened, Selection.Find finds both the old line and the new line.
- using a different keyword, which is also contained in the formerly not found doc, the doc is found.
- using the explorer-search > files and folders > text in the document the find list is complete
So it seems, as if on special lines there would lie a certain ?shadow?, by which some lines can not be recognized by Application.FileSearch. This ?shadow? remains by copy and paste.
(...)
With Application.FileSearch
.NewSearch
.LookIn = Searchpath(Modulgroup, 0)
.FileName = "*.doc"
.FileType = msoFileTypeAllFiles
.SearchSubFolders = True
.TextOrProperty = "*" + Searchtext(search) + "*"
End With
NumberFiles = Application.FileSearch.Execute()
If NumberFiles > 0 Then
For i = 1 To NumberFiles
DocFullName = Application.FileSearch.FoundFiles(i)
(...)
Next i
End If
(...)
For any kind of solution one to two million times THANKS in advance!
Greetings,
Kunz from Berlin, Germany