Send Task To Recipient Using Late Binding

rnutts

Registered User.
Local time
Today, 18:07
Joined
Jun 26, 2007
Messages
110
Hi
I am trying to send tasks to other people using access vba. I had used before in my database but was using early binding and now through version issues of office I am trying to recreate the code using late binding, however I am getting various problems with certain lines of code.
Primarily .datedue line I am getting run time error 438 objext does not support

Below is my code, could someone please point me in the direction for advice or even correct my attempt

Public Sub ASB5PostponedTask()
Dim olApp As Object
Dim olTask As Object
Dim olDateEnd As Date
Dim ToContact As Object
Dim olTaskOwner As String
olTaskOwner = "e.grainger"
Set olApp = CreateObject("outlook.application")
Set olTask = olApp.CreateItem(3)
olDateEnd = Forms!frmasb5details.JobDetsActualStartDate
olTask.subject = "ASB5 Postponed For Enquiry " & Forms!frmasb5details.EnquiryNumberID & " " & Forms!frmasb5details.JobDetsSiteAdd1 & " Adjust Air Test booking As Applicable"
olTask.body = "Adjust Date For Air Test As Required"
With olTask
.recipients.Add ("ldsaccounting@sky.com")
.Owner = olTaskOwner
.ReminderSet = True
.Importance = 2
.datedue = olDateEnd
.Save
.display
End With
End Sub


Many thanks

Richard
 
When you use late binding, constants like olDateEnd are unknown to Access. You need to use the numerical equivalent. If you still have the early binding version available, set a breakpoint and run it and you can see all those values.
 

Users who are viewing this thread

Back
Top Bottom