How do I configure my "strBody" line when there are multiple lines? I've tried strBody = "Line1" & chr(10) & "Line2" & chr(10) & "Line3" etc, but the linefeed doesn't take effect. I just get the string "Line1" & chr(10) & "Line2" & chr(10) & "Line3" in the resulting email.
Here's the code:
Code:
Public Function UnPak(TxtFile As String) As String
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
' User has several txt files, some of which are multiple lines. UnPack the files into
' a single string suitable for insertion into the subject or body parameters for CDO
' emailing.
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
Dim strInLine As String
Const strNewLine As String = " & chr(10) &"
UnPak = ""
Open TxtFile For Input As #1
Line Input #1, strInLine
If EOF(1) Then
UnPak = strInLine
Else
While Not EOF(1)
UnPak = UnPak & """" & strInLine & """" & strNewLine
Line Input #1, strInLine
Wend
UnPak = Left(UnPak, Len(UnPak) - Len(strNewLine))
End If
Close #1
End Function