I don't normally offer suggestions, as I am still learning - but, I have used
the code below to set up appointments and send emails from an Access
database. Maybe it will help?! I've cut some code out to shorten it up a
little, but I think the important stuff is in there still!
Good luck!
Function SetAppt(dteDeadline As Date, strType As String, strDoc As String)
On Error GoTo Err_Edit:
Dim strMessage As String
Dim objOutlkApp As Outlook.Application
Dim objAppt As Object
strMessage = "deadline is today. Please verify appropriate action has been
taken!"
Set objOutlkApp = CreateObject("Outlook.Application")
Set objAppt = objOutlkApp.CreateItem(olAppointmentItem)
With objAppt
.Subject = strType & " Deadline(s) for " & strDoc
.Body = strType & " Deadline set, please verify action has been taken
for: " & strDoc
.Start = dteDeadline & " 10:00"
.End = dteDeadline & " 10:30"
.ReminderSet = True
.Save
End With
Err_Edit:
MsgBox Err.Description
Resume exit1:
exit1:
End Function
Function SendApp(strPath As String, strDoc As String, strAuthor As String,
strSuper As String, strDocType As String)
Dim objOutlook As Outlook.Application
Dim objMessage As MailItem
Dim strNote As String
Dim strSuperAddr As String
Dim strBlindCopy As String
strSuperAddr = DLookup("[EmailAddress]", "Employee", "[Employee]= """ &
strSuper & """")
Set objOutlook = Outlook.Application
Set objMessage = objOutlook.CreateItem(olMailItem)
strNote = "I have just approved this SOP."
strDoc = strDoc & ".doc"
setfullpath1:
strPath = strPath & strDoc
With objMessage
.To = strSuperAddr
.CC = strAuthorAddr
.BCC = strBlindCopy3
.Subject = "Approval of " & strDoc
.Attachments.Add strPath
.Body = strNote
.Send
End With
Set objOutlook = Nothing
Set objMessage = Nothing
End Function