Is It Possible To Read Test From File And If The Word Message Exist In The File Then Show A MessageBox?
Printable View
Is It Possible To Read Test From File And If The Word Message Exist In The File Then Show A MessageBox?
vb Code:
Dim Fn As Integer Dim s As String Fn = FreeFile Open "filename.txt" For Input As #Fn Do While Not EOF(Fn) Input #Fn, s If s = "Message" Then MsgBox "Found Message!" End If Loop Close #Fn
Though, that assumes "Message" is alone on it's own line. You might want to use..
vb Code:
If InStr(1, s, "Message", vbTextCompare) Then MsgBox "Found Message in: " & s End If