Function GetLine(ByVal strFile As String, ByVal strText As String, ByVal blnCaseSensitive As Boolean) As String
'This function searches for the proper string in a text file and returns the record
Dim intFile As Integer
Dim strTemp As String
intFile = FreeFile
If Len(Dir(strFile)) > 0 Then
Open strFile For Input As intFile
While Not EOF(intFile)
Line Input #intFile, strTemp
If blnCaseSensitive Then
If InStr(strTemp, strText) > 0 Then
GetLine = strTemp
Exit Function
End If
Else
If InStr(UCase(strTemp), UCase(strText)) > 0 Then
GetLine = strTemp
Exit Function
End If
End If
Wend
Close intFile
Else
''file not found
End If
End Function