Using the code in the FAQ section I have successfully created a button which sends an email with attachment. I also want to change the properties of the outgoing email to have it automatically request a read receipt. I have searched this forum and others and have been unable to find code samples to do this. Is it possible? Can anyone point me in the right direction? I am not a very sophisticated coder so your help will ne appreciated.
Thanks.
My Code:
Private Sub Command158_Click()
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
'**gathers information from your form. this sets the string variable to your fields
email = Me!Client_email
ref = Me!LastName
FirstName = Me!FirstName
CaseNO = Me!Case_No
hearingdate = Me!Creditors_Exam_Date
hearingtime = Me!Creditors_Exam_Time
bodyNotes1 = "<html> some html stuff>"
bodyNotes2 = “more html stuff</html>"
bodyNotes3 = ""
'***creates an instance of Outlook
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
'***creates and sends email
With objEmail
.To = email
.Subject = "Appointment Reminder for " & ref & ", " & FirstName & "; " .HTMLBody = bodyNotes1 & bodyNotes2
.Display 'sends the email in Outlook. Change to DISPLAY if you want to be able to
'modify or see what you have created before sending the email
End With
'**closes outlook
'**objOutlook.Quit
'**Set objEmail = Nothing
Exit Sub
End Sub
Thanks.
My Code:
Private Sub Command158_Click()
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
'**gathers information from your form. this sets the string variable to your fields
email = Me!Client_email
ref = Me!LastName
FirstName = Me!FirstName
CaseNO = Me!Case_No
hearingdate = Me!Creditors_Exam_Date
hearingtime = Me!Creditors_Exam_Time
bodyNotes1 = "<html> some html stuff>"
bodyNotes2 = “more html stuff</html>"
bodyNotes3 = ""
'***creates an instance of Outlook
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
'***creates and sends email
With objEmail
.To = email
.Subject = "Appointment Reminder for " & ref & ", " & FirstName & "; " .HTMLBody = bodyNotes1 & bodyNotes2
.Display 'sends the email in Outlook. Change to DISPLAY if you want to be able to
'modify or see what you have created before sending the email
End With
'**closes outlook
'**objOutlook.Quit
'**Set objEmail = Nothing
Exit Sub
End Sub