Prova questo:
codice:
Private Sub Command1_Click()
Dim TextLine As String
Dim scrivi_a As Boolean
Open App.Path & "\File1.txt" For Input As #1 ' Apre il file in lettura
Open App.Path & "\File2.txt" For Output As #2 ' Apre il file in scrittura
Open App.Path & "\File3.txt" For Output As #3 ' Apre il file.
Do While Not EOF(1) ' Ripete fino alla fine del file.
Line Input #1, TextLine ' Assegna la riga a una variabile.
'Debug.Print TextLine ' Scrive nella finestra Immediata.
If TextLine = "pippo" Then scrivi_a = True
If TextLine = "pluto" Then scrivi_a = False
If scrivi_a = True Then
Print #2, TextLine
Else
Print #3, TextLine
End If
Loop
Close #1 ' Chiude il file.
Close #2
Close #3
End Sub
ciao