The acExport string will be a variable, but that should be a good example.
As of right now, I get a line by line return starting at the first line.
Thanks
Andrew
Expand|Select|Wrap|Line Numbers
- Public Function fnFindText(foldername)
- Dim strSrTxt As String
- Dim A As String
- Dim fso As Scripting.FileSystemObject
- Dim f As Scripting.TextStream
- strSrTxt = "acExport"
- Const ForReading = 1
- Set fso = CreateObject("Scripting.FileSystemObject")
- Set f = fso.OpenTextFile("XXXXX\Database Extracts\zzzMaster Code Files" _
- & "\" & foldername & " Master.txt", ForReading, True)
- Do While f.AtEndOfStream <> True
- A = f.readLine
- MsgBox (A)
- If InStr(A, strSrTxt) <> 0 Then
- boolStFnd = "True"
- fnFindText = "Text found"
- Exit Do
- End If
- Loop
- If boolStFnd <> "True" Then
- fnFindText = "Text not found"
- End If
- f.Close
- fnFindText = "File does not exists"
- End Function
- 'Path to write temp files for extract into Visio
- ''''XXXXX\Knowledge base\Database Extracts\zzzMaster Extract Transfer