Advertisement
idsystems

VBBD_Ejercicio 02

Jan 17th, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub cmdGuardar_Click()
  2. On Error GoTo ErrorDesconocido
  3.  
  4. Open "C:\DATOS.DOC" For Output As #1
  5.    
  6. Print #1, Text1.Text
  7.    
  8. Close #1
  9.    
  10. MsgBox ("Los datos han sido guardado.")
  11.  
  12. Exit Sub
  13. ErrorDesconocido:
  14.     MsgBox ("Ha ocurrido un error al intentar guardar el archivo.")
  15.  
  16. End Sub
  17.  
  18. Private Sub cmdLeer_Click()
  19. Dim Linea1, Linea2, Linea3, Linea4, Linea5, Linea6, Linea7, Linea8 As String
  20.  
  21. Open "C:\DATOS.DOC" For Input As #1
  22. Line Input #1, Linea1
  23. Line Input #1, Linea2
  24. Line Input #1, Linea3
  25. Line Input #1, Linea4
  26.  
  27. Line Input #1, Linea6
  28. Line Input #1, Linea7
  29. Line Input #1, Linea8
  30. Close #1
  31.  
  32. Text1.Text = Linea1 & Chr(10) & Chr(13) & Linea2 & Chr(10) & Chr(13) & Linea3 & Chr(10) _
  33. & Chr(13) & Linea4 & Chr(10) & Chr(13) & Linea5 & Chr(10) & Chr(13) & Linea6 & Chr(10) _
  34. & Chr(13) & Linea7 & Chr(10) & Chr(13) & Linea8
  35.  
  36. End Sub
  37.  
  38. Private Sub cmdSalir_Click()
  39. End
  40. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement