-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathComentario.bas
81 lines (54 loc) · 2.22 KB
/
Comentario.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Attribute VB_Name = "Comentario"
'---------------------------------------------------------------------------------------
' Module : Comentario
' DateTime : 26/10/2003 21:20
' Author : Administrador
' Purpose : Rutinas para gestionar los comentarios por medio de
' BWord (proyecto Editor).
'---------------------------------------------------------------------------------------
Option Explicit
'---------------------------------------------------------------------------------------
' Procedure : guardar_rtf_campo
' DateTime : 26/10/2003 21:22
' Author : Administrador
' Purpose : Guarda el contenido de un fichero RTF en un campo
' (ADODB.Field). Devuelve FALSE si no ha ocurrido ningun error.
'---------------------------------------------------------------------------------------
Public Function guardar_rtf_campo(ficheroRTF As String, campo As ADODB.Field) As Boolean
Dim linea As String
Dim numfile As Integer
On Error GoTo guardar_rtf_campo_Error
numfile = FreeFile
'abrir el fichero
Open ficheroRTF For Input As #numfile
'leer linea a linea
Do While Not EOF(numfile)
Input #numfile, linea
'asignar el contenido al campo
campo.Value = campo.Value & linea
Loop
Close #numfile
On Error GoTo 0
Exit Function
guardar_rtf_campo_Error:
guardar_rtf_campo = True
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure guardar_rtf_campo of Módulo Comentario", vbExclamation, titulo
End Function
'---------------------------------------------------------------------------------------
' Procedure : lee_RTF_campo
' DateTime : 26/10/2003 21:35
' Author : Administrador
' Purpose : leer contenido de un campo y guardar en un fichero de texto (RTF)
'---------------------------------------------------------------------------------------
Public Function lee_RTF_campo(campo As ADODB.Field, ficheroRTF As String)
Dim linea As String
Dim var As Long
On Error GoTo lee_RTF_campo_Error
For var = 1 To Len(campo.Value)
Next
linea = ""
On Error GoTo 0
Exit Function
lee_RTF_campo_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure lee_RTF_campo of Módulo Comentario", vbExclamation, titulo
End Function