I
icsupt via AccessMonster.com
I have the below code. What I am trying to do is to have an email generated
from a form. The form has several fields that I would like included in the
email:
Addressees
Subject
txtbody1
txtproducts1
txtproducts2
txtproducts3
txtproducts4
txtproducts5
txtbody2
I would like the email to have txtbody1 as the first paragraph. Then a blank
line and then have txtproducts1 through txtproducts5 as bullets underneath
txtbody1. Then another blank line and then txtbody2.
Right now, everything is in one paragraph. I am not sure how to insert blank
lines in code so they can be separate paragraphs. Can anyone tell me what I
am doing wrong here? Thanks in advance.
Private Sub Command29_Click()
On Error GoTo Err_Command0_Click
Dim stext As String
Dim sAddedtext As String
If Len(txtMainAddresses) Then
stext = txtMainAddresses
End If
If Len(txtCC) Then
sAddedtext = sAddedtext & "&CC=" & txtCC
End If
If Len(txtBCC) Then
sAddedtext = sAddedtext & "&BCC=" & txtBCC
End If
If Len(txtSubject) Then
sAddedtext = sAddedtext & "&Subject=" & txtSubject
End If
If Len(txtBody) Then
sAddedtext = sAddedtext & "&Body=" & txtBody & " " & txtProducts1 & "
" & txtbody2
End If
'If Len(txtAttachment) Then
' sAddedtext = sAddedtext & "Attach=" & Chr$(34) & txtAttachment & Chr
$(34)
'End If
stext = "mailto:" & stext
If Len(sAddedtext) <> 0 Then
Mid$(sAddedtext, 1, 1) = "?"
End If
stext = stext & sAddedtext
' launch default e-mail program
If Len(stext) Then
Call ShellExecute(hwnd, "open", stext, vbNullString, vbNullString,
SW_SHOWNORMAL)
End If
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
'End If
End Sub
from a form. The form has several fields that I would like included in the
email:
Addressees
Subject
txtbody1
txtproducts1
txtproducts2
txtproducts3
txtproducts4
txtproducts5
txtbody2
I would like the email to have txtbody1 as the first paragraph. Then a blank
line and then have txtproducts1 through txtproducts5 as bullets underneath
txtbody1. Then another blank line and then txtbody2.
Right now, everything is in one paragraph. I am not sure how to insert blank
lines in code so they can be separate paragraphs. Can anyone tell me what I
am doing wrong here? Thanks in advance.
Private Sub Command29_Click()
On Error GoTo Err_Command0_Click
Dim stext As String
Dim sAddedtext As String
If Len(txtMainAddresses) Then
stext = txtMainAddresses
End If
If Len(txtCC) Then
sAddedtext = sAddedtext & "&CC=" & txtCC
End If
If Len(txtBCC) Then
sAddedtext = sAddedtext & "&BCC=" & txtBCC
End If
If Len(txtSubject) Then
sAddedtext = sAddedtext & "&Subject=" & txtSubject
End If
If Len(txtBody) Then
sAddedtext = sAddedtext & "&Body=" & txtBody & " " & txtProducts1 & "
" & txtbody2
End If
'If Len(txtAttachment) Then
' sAddedtext = sAddedtext & "Attach=" & Chr$(34) & txtAttachment & Chr
$(34)
'End If
stext = "mailto:" & stext
If Len(sAddedtext) <> 0 Then
Mid$(sAddedtext, 1, 1) = "?"
End If
stext = stext & sAddedtext
' launch default e-mail program
If Len(stext) Then
Call ShellExecute(hwnd, "open", stext, vbNullString, vbNullString,
SW_SHOWNORMAL)
End If
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
'End If
End Sub