You need to read the data into a variable from the textstream. If you need to search for a string that crosses line boundaries (has an embedded newline in it), then you can use ReadAll() instead of ReadLine(). Then you can use the InStr() on that data.
Dim fso As New Scripting.FileSystemObject
Dim ts As Scripting.TextStream
Dim s As String
Dim n As Long
Set ts = fspenTextFile(<file>)
s = ts.ReadAll
n = InStr(1, s, "Value"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.