How To Read TXT File And Place In Special Labelxyz.Caption?
I need to know how to extract a exact line from the text file, and then place it into an exact Labelxyz.Caption control.
The line of text in the text file, will be the same all the time. Also the control that is linked to that particular line, will also be the same for every text file that is made by the Client App of this project, that I am making with VB6 Pro.
Re: How To Read TXT File And Place In Special Labelxyz.Caption?
Not sure exactly what you are talking about but is this what you want?
Code:
Dim TextData As String
Open TextFile For Binary As #1
TextData = String(LOF(1), 0)
Get #1, 1, TextData
Close #1
q = Instr(TextData, ExactLineOfText)
If q > 0 Then
Labelxyz.Caption = Mid(TextData, q, Len(ExactLineOfText))
End if
Re: How To Read TXT File And Place In Special Labelxyz.Caption?
I would recommend to use the FSO Com Object...
Re: How To Read TXT File And Place In Special Labelxyz.Caption?
jmsrickland, could you please check the code that you had sent to me; I had found many errors in the code.
Re: How To Read TXT File And Place In Special Labelxyz.Caption?
In his post there are certain things that you need to replace like TextFile, etc... Those are just descriptions to give you a hint on what to place in those values...