El componente RichTextBox tiene funciones incorporadas que lo hacen automaticamente (Cuestión que veas el Object Browser ... ese que sale con F2 en el Visual Basic IDE)
Por otro lado, hice una simple busqueda en Google y me devolvio muchisimos resultados ... debiste empezar por ahi
*************************************
ESCRIBIR ARCHIVOS
Código :
Dim fnum As Integer
fnum = FreeFile 'se obtiene el numero de archivo
Open "C:\Archivo.txt" For Output As fnum 'se abre para escritura
' Escribe las lineas de texto
Print #fnum, "LINEA 1"
Print #fnum, "LINEA 2"
Close fnum 'se cierra el archivo
***********************************************
(Para esta seccion hay que agregar en PROYECTO -> REFERENCIAS la siguiente: Microsoft Scripting Runtime)
LEER ARCHIVOS
Código :
Dim Leer
Dim MiRegistro as String
Dim Maneja As New FileSystemObject
Set Leer = Maneja.OpenTextFile("C:\Archivo.txt", ForReading)
Do While Leer.AtEndOfStream <> True 'Mientras haya lineas para leer del archivo
MiRegistro = Leer.ReadLine
msgbox MiRegistro
Loop
Leer.Close 'Se cierra