Hi, I would not consider myself to be an expert in this and have a problem that hopefully someone can help me with.
I'm trying set an appointment in Outlook from a form in Access. Having scoured around, I produced the following:
Public Function CreateAppointment(SubjectStr As String, BodyStr As String, StartTime As Date, EndTime As Date, AllDay As Boolean)
Dim OlApp As Object
Dim Appt As Object
Set OlApp = CreateObject("Outlook.Application")
Set Appt = OlApp.CreateItem(olAppointmentItem)
Appt.Subject = SubjectStr
Appt.Start = StartTime
Appt.End = EndTime
Appt.AllDayEvent = AllDay
ApptBody = BodyStr
Appt.Save
Set Appt = Nothing
Set OlApp = Nothing
End Function
However, when I try to run it, it crunches on App.Start = StartTime with a runtime error 438 - Object doesn't support this property or method.
The other bit of code you'll need, is this bit:
Private Sub cboToOutlook_Click()
CreateAppointment "My Test", Me.txtMtgDet, Me.txtTime, Me.cboEndTime, True
End Sub
where we get the data for StartTime (being the third argument and provided by txtTime (which is in short time format).
Any ideas? I'm using Access 2002.
Thanks in advance, Chris Buckmaster
I'm trying set an appointment in Outlook from a form in Access. Having scoured around, I produced the following:
Public Function CreateAppointment(SubjectStr As String, BodyStr As String, StartTime As Date, EndTime As Date, AllDay As Boolean)
Dim OlApp As Object
Dim Appt As Object
Set OlApp = CreateObject("Outlook.Application")
Set Appt = OlApp.CreateItem(olAppointmentItem)
Appt.Subject = SubjectStr
Appt.Start = StartTime
Appt.End = EndTime
Appt.AllDayEvent = AllDay
ApptBody = BodyStr
Appt.Save
Set Appt = Nothing
Set OlApp = Nothing
End Function
However, when I try to run it, it crunches on App.Start = StartTime with a runtime error 438 - Object doesn't support this property or method.
The other bit of code you'll need, is this bit:
Private Sub cboToOutlook_Click()
CreateAppointment "My Test", Me.txtMtgDet, Me.txtTime, Me.cboEndTime, True
End Sub
where we get the data for StartTime (being the third argument and provided by txtTime (which is in short time format).
Any ideas? I'm using Access 2002.
Thanks in advance, Chris Buckmaster