as I let to append a line to the beginning of a file in which they are already there other lines ?
Printable View
as I let to append a line to the beginning of a file in which they are already there other lines ?
This one needs one textbox & 1 command button ...VB Code:
Private Sub Command1_Click() Dim strCurrentFileText As String Open "C:\File.txt" For Input As #1 Do Until EOF(1) strCurrentFileText = Input(LOF(1), 1) Loop Close #1 Open "C:\File.txt" For Output As #1 strCurrentFileText = "Hello World" & vbCrLf & strCurrentFileText Print #1, strCurrentFileText Close #1 MsgBox "File Written To!" Unload Me End Sub