Hi Stockwell,
Is there a way to have the email return a read receipt without having to
manually select on every email?
Yes, as long as you are using Outlook as your e-mail client and not Outlook
Express. See this article:
Using Automation in Microsoft Office Access 2003 to
Work with Microsoft Office Outlook 2003
http://msdn.microsoft.com/en-us/library/aa159619(office.11).aspx
The code in this MSDN article is a bit messed up, so I fixed it and pasted
the fixed version below (specifically, there were two errors in the code). In
addition, I added the line of code ".ReadReceiptRequested = True" (marked
below with a arrow comment). This version has hard-coded To and CC names, so
you may need to modify the procedure to allow you to pass in the appropriate
e-mail addresses as input parameters.
Option Compare Database
Option Explicit
Sub sbSendMessage(Optional AttachmentPath)
On Error GoTo ErrorMsgs
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
' Add the To recipient(s) to the message. Substitute
' your names here.
Set objOutlookRecip = .Recipients.Add("Nancy Davolio")
objOutlookRecip.Type = olTo
' Add the CC recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add("Andrew Fuller")
objOutlookRecip.Type = olCC
' Set the Subject, Body, and Importance of the message.
.Subject = "This is an Automation test with Microsoft Outlook"
.Body = "Last test." & vbCrLf & vbCrLf
.Importance = olImportanceHigh 'High importance
.ReadReceiptRequested = True '<-------------
' Add attachments to the message.
If Not IsMissing(AttachmentPath) Then
Set objOutlookAttach = .Attachments.Add(AttachmentPath)
End If
' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
If Not objOutlookRecip.Resolve Then
objOutlookMsg.Display
End If
Next
.Send
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
Set objOutlookRecip = Nothing
Set objOutlookAttach = Nothing
ErrorMsgs:
If Err.Number = "287" Then
MsgBox "You clicked No to the Outlook security warning. " & _
"Rerun the procedure and click Yes to access e-mail" & _
"addresses to send your message. For more information, " & _
"see the document at
http://www.microsoft.com/office" & _
"/previous/outlook/downloads/security.asp."
Else
MsgBox Err.Number, Err.Description
End If
End Sub
Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________