I am using the folllowing code to try to send an Outlook task but I a getting an error everytime. The error is:
Run-time error '-1871691771 (90404005)'
THe task is stored as a file, not as an item in an Outlook folder, so the requested action can not be performed.
Code:
Dim OutlookApp As New Outlook.Application
Dim OutlookTask As Outlook.TaskItem
Dim AssignedTo As Outlook.Recipient
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookTask = OutlookApp.CreateItem(olTaskItem)
OutlookTask.Assign
Set AssignedTo = OutlookTask.Recipients.Add("mrbboy@comcast.net")
OutlookTask.Subject = "You have been assigned a task. See CAR Number "
OutlookTask.Body = "Test"
OutlookTask.DueDate = Now
OutlookTask.Importance = (olImportanceHigh)
OutlookTask.ReminderSet = True
OutlookTask.Save
OutlookTask.Send
OutlookApp.Quit
Set oulookTask = Nothing
When I run the code, I get the error message and OutlookTask.Assign is highlighted. Can someone tell me why I can't assign the task to the recipient?
Run-time error '-1871691771 (90404005)'
THe task is stored as a file, not as an item in an Outlook folder, so the requested action can not be performed.
Code:
Dim OutlookApp As New Outlook.Application
Dim OutlookTask As Outlook.TaskItem
Dim AssignedTo As Outlook.Recipient
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookTask = OutlookApp.CreateItem(olTaskItem)
OutlookTask.Assign
Set AssignedTo = OutlookTask.Recipients.Add("mrbboy@comcast.net")
OutlookTask.Subject = "You have been assigned a task. See CAR Number "
OutlookTask.Body = "Test"
OutlookTask.DueDate = Now
OutlookTask.Importance = (olImportanceHigh)
OutlookTask.ReminderSet = True
OutlookTask.Save
OutlookTask.Send
OutlookApp.Quit
Set oulookTask = Nothing
When I run the code, I get the error message and OutlookTask.Assign is highlighted. Can someone tell me why I can't assign the task to the recipient?