Hi Everyone,
I'm trying to email through access but I'm not sure how to make an attachment. The code to generate an email works fine but i have been requested to have the ability to add an attachment. This is my code:
Thanks,
Nim
I'm trying to email through access but I'm not sure how to make an attachment. The code to generate an email works fine but i have been requested to have the ability to add an attachment. This is my code:
Code:
Private Sub Command23_Click()
On Error Resume Next
Dim strToWhom As String
Dim strMsgBody As String
Dim strTitle As String
With Me.Recordset
.MoveFirst
While Not .EOF
strToWhom = strToWhom & ";" & Me!Email
strToWhom = Mid(strToWhom, 2)
strMsgBody = "Dear " & Me!Name & " " & Me!Text9 & "," & vbCrLf _
& vbCrLf _
& Me!emailtxt & vbCrLf _
& vbCrLf _
& "Kind Regards," & vbCrLf _
& "Helena" & vbCrLf _
& "Helena Cleaning Services" & vbCrLf _
& "0414272616" & vbCrLf _
strTitle = strTitle & Me!title
DoCmd.SendObject , , , strToWhom, , , strTitle, strMsgBody, False
strToWhom = ""
.MoveNext
Wend
End With
End Sub
Thanks,
Nim