Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/03/2005, 13:08
Avatar de aavg
aavg
 
Fecha de Ingreso: abril-2002
Ubicación: Morelia México
Mensajes: 356
Antigüedad: 22 años
Puntos: 1
Perdon por la tardanza, han sido dias llenos de trabajo pero aqui esta el ejemplo que prometí

*************************************
ESCRIBIR ARCHIVOS

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

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
__________________
Abraham Velasco
Usuario # 516 en los Foros del Web.
El hombre no vale por lo que sabe, sino por lo que transmite
C'est parce qu'il y a un Dieu que nous sommes libres