How can I reliably get line breaks when using .sendObject?

P

plh

Hello,
When using the following code:
........
If Me.FrmRespondedOrNot = 2 Then

strTest = Me.cbxOperators.Column(3)
strTest = Me.IssueTypeID.Column(1)

strMessageText = "Green Sheet issue #" & Me.IssueId & Chr(10) & _
"Concerning " & Me.IssueTypeID.Column(1) & Chr(10) & _
"Description: " & Me.txtIssueDescription & Chr(10) & _
"Has been resolved as follows:" & Chr(10) & _
Me.txtIssueResolution

Debug.Print strMessageText

DoCmd.SendObject , , , Me.cbxOperators.Column(3), mbrum, , "Green Sheet
Resolution", strMessageText, False

Me.FrmRespondedOrNot = 1

Else
..........

The chr(10) calls don't seem to result in a CR/LF in the mail message, the way
they do on, say, a message box.
Suggestions? Any would be greatly appreciated!
-plh
 
D

Douglas J. Steele

Use either Chr$(13) & Chr$(10) in that order, or the intrinsic constant
vbCrLf
 
P

plh

Thank you for your reply
I changed it to:

strTest = Me.cbxAssignedTo.Column(3)
strTest = Me.IssueTypeID.Column(1)

strMessageText = "Green Sheet issue #" & Me.IssueId & vbCrLf & _
"Concerning " & Me.IssueTypeID.Column(1) & vbCrLf & _
"Description: " & Me.txtIssueDescription & vbCrLf & _
"Has been assigned to you." & vbCrLf & _
"Please give this matter your attention."

DoCmd.SendObject , , , Me.cbxAssignedTo.Column(3), , , "New Green Sheet
Assignment", strMessageText, False

And the result I got is:

Green Sheet issue #12
Concerning Router
Description: description issue test2 Has been assigned to you. Please give this
matter your attention.

That is, it works up until Me.txtIssueDescription -- A text box, control source
is of type "memo". When I open the email message, it looks correct for a
fraction of a second, then re-formats as shown above. Anything else I can try?
Thank you,
-plh
 
D

Douglas J. Steele

Makes no sense to me, but see whether using the CStr function around
Me.txtIssueDescription, or, even better, something like
Left(Me.txtIssueDescription, 255)

Is there a real need for the description to be a memo?
 
P

plh

Thank you for you reply.
I made it into text with a length of 255. Also I tried:

strTest = Left(Me.txtIssueDescription, 255)

strMessageText = "Green Sheet issue #" & Me.IssueId & vbCrLf & _
"Concerning " & Me.IssueTypeID.Column(1) & vbCrLf & _
"Description: " & strTest & vbCrLf & _
"Has been assigned to you." & vbCrLf & _
"Please give this matter your attention."

Same result, but this may be relevant:
In the preview pane (in Outlook) it looks OK. The preview pane is in plain ASCII
text, but when opening mail it is MS Word of perhaps Rich Text, it depends on
how the user has it set up. Does that provide any clues?
Thank You,
-plh
 
J

John Nurick

It might be worth trying two vbCRLFs instead of one:

strMessageText = "Green Sheet issue #" & Me.IssueId _
& vbCrLf & vbCrLf _
& "Concerning " & Me.IssueTypeID.Column(1) _
& vbCrLf & vbCrLf _
...
 
P

plh

Hi,
I did that so that it became:
strMessageText = "Green Sheet issue #" & Me.IssueId & vbCrLf & _
"Concerning " & Me.IssueTypeID.Column(1) & vbCrLf & _
"Description: " & strTest & vbCrLf & vbCrLf & _
"Has been assigned to you." & vbCrLf & _
"Please give this matter your attention."
and the result is at least acceptable. Both CR/LFs show up, so there is a blank
line, but I can live with that.
Thanx,
-plh
 
Top