Unanswered: Automation Help: Email from Access 03 to Outlook 07
This is a two part question.
The code Im using (listed below) creates and sends an e-mail but in my sent items the sent email doesnt display a recipient name and i get a response from admin saying (STAFFNAME is actually a member of staffs e-mail address removed for this post)
Your message did not reach some or all of the intended recipients.
Subject: Holiday Request
Sent: 17/11/2011 09:44
The following recipient(s) cannot be reached:
STAFFNAME on 17/11/2011 09:44
This message could not be sent. Try sending the message again later, or contact your network administrator. Error is [0x80070057-00000000-00000000].
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
Set objOutlookRecip = .Recipients.Add("STAFFNAME")
objOutlookRecip.Type = olTo
.Subject = "Holiday Request"
.Body = "Test" & vbCrLf
For Each objOutlookRecip In .Recipients
If Not objOutlookRecip.Resolve Then
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
Set objOutlookRecip = Nothing
Set objOutlookAttach = Nothing
How can I select information from a queary to populate the relevant fields?
I have tried some variations in the body part of the e-mail as a test but no luck so far