Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing a new line in the body of an email

Status
Not open for further replies.

matpj

Technical User
Mar 28, 2001
687
GB
Hi,
I have a command button within my Access database which opens up my email program and writes the 'To:' address, the 'Subject' line and the body text.

How do I tell it to start a new line in the body text?
I need to list down the contents of 5 text-boxes, but can only seem to do it in one line.

any ideas?
 
try
firstline & vbcrlf & secoundline & vbcrlf & ...

Sunaj
 
that doesn't seem to do anything. no errors are reported, but the next textbox is not put on the line below.

should I paste my code here so you can view it?
I actually used DougP's code, and modified it, so I don't know exactly how it works!
 
Here is the code.
Let me know if I need to explain anything. I'm not sure exactly what it does. Orignially the user was faced with fields to type the information in, but I changed it so that the Subject and the To: address were automatic!
You will be able to see the part that I used your 'vbcrlf' function.


Private Sub Command51_Click()
Dim stext As String
Dim sAddedtext As String
'recipient's email address
stext = "info@excel-intouch.co.uk"

' Subject ofEmail

sAddedtext = sAddedtext & "&Subject=" & "Late Order"
'BodyText

sAddedtext = sAddedtext & "&Body=" & Combo33 & vbCrLf & Combo42

stext = "mailto:" & stext

If Len(sAddedtext) <> 0 Then
Mid$(sAddedtext, 1, 1) = &quot;?&quot;
End If

stext = stext & sAddedtext

' launch default e-mail program
If Len(stext) Then
Call ShellExecute(Me.hwnd, &quot;open&quot;, stext, vbNullString, vbNullString, 0)
End If

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top