Save and Lost Text Files


Sub LoadText(Lst As TextBox, file As String)
‘Call LoadText (Text1,”C:\Windows\System\Saved.txt”)
On Error GoTo error
Dim mystr As String
Open file For Input As #1
Do While Not EOF(1)
Line Input #1, a$
texto$ = texto$ + a$ + Chr$(13) + Chr$(10)
Loop
Lst = texto$
Close #1
Exit Sub
error:
X = MsgBox(“File Not Found”, vbOKOnly, “Error”)
End Sub

Sub SaveText(Lst As TextBox, file As String)
‘Call SaveText (Text1,”C:\Windows\System\Saved.txt”)
On Error GoTo error
Dim mystr As String
Open file For Output As #1
Print #1, Lst
Close 1
Exit Sub
error:
X = MsgBox(“There has been a error!”, vbOKOnly, “Error”)
End Sub

‘From:PulseWave

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s