A
Albert
Hi guys,
I am trying to create a task from a commandbutton in a userform.
This is what I got so far:
Sub CreateTask()
Dim oApp As Object
Set oApp = CreateObject("Outlook.Application")
Dim objTask As Object
Set objTask = oApp.CreateItem(olFolderTasks)
With objTask
.Subject = "Test"
.Body = "Test"
.DueDate = DateValue("06/26/03")
.Startdate = DateValue("06/26/03")
.Send
.Close olSave
End With
Set objTask = Nothing
End Sub
Obviously it is not working as I get a runtime error "Object does not
support the object or method" at the "duedate.
Can anyone help me with the correct code?
Thanks
Albert
I am trying to create a task from a commandbutton in a userform.
This is what I got so far:
Sub CreateTask()
Dim oApp As Object
Set oApp = CreateObject("Outlook.Application")
Dim objTask As Object
Set objTask = oApp.CreateItem(olFolderTasks)
With objTask
.Subject = "Test"
.Body = "Test"
.DueDate = DateValue("06/26/03")
.Startdate = DateValue("06/26/03")
.Send
.Close olSave
End With
Set objTask = Nothing
End Sub
Obviously it is not working as I get a runtime error "Object does not
support the object or method" at the "duedate.
Can anyone help me with the correct code?
Thanks
Albert