Visual Basic - ARCHIVO TXT

Life is soft - evento anual de software empresarial
 
Vista:

ARCHIVO TXT

Publicado por MBO** (17 intervenciones) el 30/12/2003 21:46:52
Quisiera saber como guardar y abrir un textbox, asi como lo hace word, pero nada mas con esa funcion
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:ARCHIVO TXT

Publicado por Cecilia Colalongo (3116 intervenciones) el 31/12/2003 02:22:43
Si te refieres a abrir y guardar un archivo de texto en un TextBox fijate con esto:

Text1.Text=FileToString("MiArchivo.txt")

Public Function FileToString(FileName As String) As String
Dim hlngFile As Long, strFile As String

hlngFile = FreeFile

Open FileName For Binary Access Read As hlngFile

FileToString = vbNullString

strFile = String(FileLen(FileName), " ")

Get hlngFile, , strFile

Close hlngFile

FileToString = strFile

End Function

Y para el proceso inverso:

StringToFile Text1.Text,"MiArchivo.txt"

Public Function StringToFile(StringText As String, FileName As String) As Long
Dim hlngFile As Long

hlngFile = FreeFile

Open FileName For Binary Access Write As hlngFile

Put hlngFile, , StringText

Close hlngFile

StringToFile = FileLen(FileName)

End Function
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar