ok i have stolen enought code to get to the place i can create an email with a custome message but i am stuck at trying to add some information from some of the fields in my database. I need to add the data in field called networkid and others.
Private Sub Command20_Click()
Dim mess_body As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
.To = Me.Email_Address
.Subject = Me.Mess_Subject
.HTMLBody = "<HTML><BODY>"
"<p><b><font color=red><font size=6>Please READ all " & _
"custom message
"</BODY></HTML>"
If Left(Me.Mail_Attachment_Path, 1) <> "<" Then
.Attachments.Add (Me.Mail_Attachment_Path)
End If
'.DeleteAfterSubmit = False 'This would let Outlook send th note without storing it in your sent bin
.Display
'.send
End With
'MsgBox MailOutLook.Body
'Exit Function
'email_error:
'MsgBox "An error was encountered." & vbCrLf & "The error message is: " & Err.Description
'Resume Error_out
Error_out:
'End Function
End Sub
Thanks Roxanne
Private Sub Command20_Click()
Dim mess_body As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
.To = Me.Email_Address
.Subject = Me.Mess_Subject
.HTMLBody = "<HTML><BODY>"
"<p><b><font color=red><font size=6>Please READ all " & _
"custom message
"</BODY></HTML>"
If Left(Me.Mail_Attachment_Path, 1) <> "<" Then
.Attachments.Add (Me.Mail_Attachment_Path)
End If
'.DeleteAfterSubmit = False 'This would let Outlook send th note without storing it in your sent bin
.Display
'.send
End With
'MsgBox MailOutLook.Body
'Exit Function
'email_error:
'MsgBox "An error was encountered." & vbCrLf & "The error message is: " & Err.Description
'Resume Error_out
Error_out:
'End Function
End Sub
Thanks Roxanne