I need to call back what i had write in notepad using vb application. I can do it using the coding below but the problem is i want to retrive the value in different textbox but all the values in notepad appear in 1 textbox.Like in notepad i got values like
f
g
In textbox the values appear like Text1 = fg
Text2 = fg
Actually i want like Text1 = f
Text2 = g
Coding:
Public Sub LoadTextBox(Not epadFile$, XTextBox As TextBox)
On Error GoTo a:
Dim chk As String
Dim hld As String
If Dir(NotepadFile $, vbNormal) = "" Then
MsgBox "File Not Found: " & NotepadFile$
Exit Sub
End If
Open NotepadFile$ For Input As #1
Do Until EOF(1)
Line Input #1, chk
hld = hld & chk & vbNewLine
Loop
Close #1
hld = Left(hld, Len(hld) - 2)
XTextBox.Text = hld
a:
End Sub
Private Sub Form_Load()
FName$ = "D:\Output. txt"
LoadTextBox FName$, Text1
LoadTextBox FName$, Text2
End Sub
f
g
In textbox the values appear like Text1 = fg
Text2 = fg
Actually i want like Text1 = f
Text2 = g
Coding:
Public Sub LoadTextBox(Not epadFile$, XTextBox As TextBox)
On Error GoTo a:
Dim chk As String
Dim hld As String
If Dir(NotepadFile $, vbNormal) = "" Then
MsgBox "File Not Found: " & NotepadFile$
Exit Sub
End If
Open NotepadFile$ For Input As #1
Do Until EOF(1)
Line Input #1, chk
hld = hld & chk & vbNewLine
Loop
Close #1
hld = Left(hld, Len(hld) - 2)
XTextBox.Text = hld
a:
End Sub
Private Sub Form_Load()
FName$ = "D:\Output. txt"
LoadTextBox FName$, Text1
LoadTextBox FName$, Text2
End Sub
Comment