Hi
How can I inport all the file Inpoort.txt in vb6?
tanks :twisted:

Recommended Answers

You need to use FileSystemObject.

Jump to Post

All 2 Replies

You need to use FileSystemObject.

Dim TS As TextStream
Dim strLine As String
Dim FSO As New FileSystemObject
     Set FSO = Nothing
     Set FSO = New FileSystemObject
     FSO.OpenTextFile ("C:\Mytextfile.txt")
     Set TS = FSO.OpenTextFile("C:\Mytextfile.txt")
     While Not TS.AtEndOfStream = True
          strLine = Trim(TS.ReadLine)
          Debug.Print Trim(strLine)
     Wend
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.