Function EText(ByVal strText As String)
Dim i As Integer
Dim strTemp As String
Dim Found As Boolean = False
For i = 1 To Len(strText)
If Asc(Mid(strText, i, 1)) = 32 Then
strTemp = strTemp + " "
ElseIf Asc(Mid(strText, i, 1)) = 13 Then
ElseIf Asc(Mid(strText, i, 1)) = 10 Then
strTemp = strTemp + "<br>"
ElseIf Asc(Mid(strText, i, 1)) = 39 Then
If Not Found Then
strTemp = strTemp + "‘"
Found = True
Else
strTemp = strTemp + "’"
Found = False
End If
ElseIf Asc(Mid(strText, i, 1)) = 34 Then
strTemp = strTemp + """"
Else
strTemp = strTemp + Mid(strText, i, 1)
End If
Next
EText = strTemp
End Function
Function DText(ByVal strText As String)
Dim strTmp As String
Dim Skip As Integer = 0
Dim i As Integer
For i = 1 To Len(strText)
If Mid(strText, i, 6) = " " Then
Skip = 6
strTmp = strTmp + " "
ElseIf Mid(strText, i, 4) = "<br>" Then
Skip = 4
strTmp = strTmp + Chr(13)
Else
If Skip = 0 Then strTmp = strTmp + Mid(strText, i, 1)
End If
If Skip > 0 Then Skip -= 1
Next
DText = strTmp
End Function