Hur gör man för att något i en TextBox ska hamna i en .txt fil och hur gör man sen om man vill ladda filen in i programmet? Private Sub TextboxTIllFil(i_txt As TextBox)Skriva till en text fil?
Sv: Skriva till en text fil?
Dim ff As Integer
ff = FreeFile
'Töm filen
Open "c:\temp\min_fil.txt" For Output As #ff
Close #ff
'Skriv
Open "c:\temp\min_fil.txt" For Binary As #ff
Put #ff, , i_txt.Text
Close #ff
End Sub
Private Sub FilTillTextBox(i_txt As TextBox)
Dim ff As Integer
Dim foo As String
ff = FreeFile
Open "c:\temp\min_fil.txt" For Binary As #ff
foo = Space(LOF(ff))
Get #ff, , foo
Close #ff
i_txt.Text = foo
End Sub
/johan/