1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
Private Sub Command1_Click()
Dim str1
str1 = Text1.Text
'Crée le fichier LuResult.txt sur le disque C:\ et copie les données du TextBox.
Open "C:\LuResult.txt" For Output As #1
Print #1, str1
Close #1
End Sub
Private Sub Form_Load()
'Ouvre le fichier dans le TextBox, si tu le modifie, tu cliques sur Command1 qui enregistrera le nouveau fichier
Dim crlf, tout, texte
On Error Resume Next
crlf = Chr(13) + Chr(10)
Open "C:\LuResult.txt" For Input As #1
Line Input #1, texte
tout = texte
If Len(tout) <> 0 Then
While Not EOF(1)
Line Input #1, texte
tout = tout + crlf + texte
Wend
End If
Text1.Text = tout
Close #1 |
Partager