Private Function DoesFileContainWord(ByVal fileName As String, ByVal word As String) As Boolean
'Open the file.
Dim file As New StreamReader(fileName)
Try
'Look for the word.
While file.Peek() <> -1
If file.ReadLine().IndexOf(word) <> -1
'The word has been found.
Return True
End If
End While
Finally
'Close the file.
file.Close()
End Try
'The word was not found.
Return False
End Function