< Public Function ConvertCrToCrLf (InText As String) As String (?)

Comments

'------------------------------------------------------------------------- 'Goes through a string, converting all CR characters to a CR/LF pair '-------------------------------------------------------------------------

Public Function ConvertCrToCrLf (InText As String) As String

    Dim outText As String
    Dim i As Integer
    Dim Temp As String
    If InText = "" Then Exit Function
    
    For i = 1 To Len(InText)
        Temp = Mid(InText, i, 1)
        Select Case Temp
            Case Chr(10), Chr(13)
                outText = outText & vbCrLf
            Case Else:
                outText = outText & Temp
        End Select
    Next
    
    ConvertCrToCrLf = outText
End Function


Copying, Return to index