Search string Text File No FSO

  • Thread starter Thread starter rebelscum0000
  • Start date Start date
R

rebelscum0000

Dear all,

How to read an entire txt file in order to serch for a string without
using FSO?

Thanks in advance

Regards
Antonio Macias
 
Dim intFile As Integer
Dim strBuffer As String
Dim strFile As String

strFile = "C:\MyFolder\MyFile.txt"
strBuffer = Space(FileLen(strFile))
intFile = FreeFile()
Open strFile For Binary Access Read As intFIle
Get #intFile, , strBuffer
Close #intFile

strBuffer will now contain the entire content of the file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top