>It seems to work for single characters, but for some reason it refuses to find any actual strings in my text documents... which is strange.
I would be surprised if it works only for single character. It should work as well for a string.
Two problems though might arise.
[1] If the file being inexisting and/or of size zero (empty file, in case of inexisting, the newly created one would also be empty). Then .readall may fail. Hence, to make it more robust, control of those two factors may help. if you want to retain the one-line appeal, you can put on error control.
[tt]
Dim FoundIt 'as boolean
FoundIt=false 'initialize it to false
With createobject("Scripting.FileSystemObject")
on error resume next
FoundIt = (InStr(1,.OpenTextFile("C:\...\myFile.html",1,true,-2).ReadAll,"SomeString",1) <> 0)
on error goto 0
End With
[/tt]
[2] The format unicode/ascii the particular file was being saved. The above use system default (parameter -2). But on winnt series, it might be defaulted to unicode whereas somehow if the html file was saved in ascii, it would fail. And the same vice versa.
So if you are sure the file exists and that the result is unexpected, you should look into the parameter -2. Try change it to 0 and -1 successively (depending on the os.) That would be the source of the problem.