also to find a string in a file:

VB Code:
  1. Option Explicit
  2.  
  3. Private Sub FindInFile(strFilePath As String, strString As String)
  4.     Dim strFile As String
  5.     Dim lngPos As Long
  6.    
  7.     Open strFilePath For Binary As #1
  8.         strFile = Input(LOF(1), #1)
  9.     Close #1
  10.    
  11.     lngPos = InStr(strFile, strString)
  12.    
  13.     If lngPos > 0 Then
  14.         MsgBox "'" & strString & "' found in file: " & strFilePath & " at character position " & lngPos
  15.     Else
  16.         MsgBox "'" & strString & "' not found in file: " & strFilePath
  17.     End If
  18. End Sub
  19.  
  20. Private Sub Form_Load()
  21.     FindInFile "C:\test.txt", "bob"
  22. End Sub