Please help me, I am getting this error for the following code:
Run time error: 91;
Object variable or with block variable not set
Thank you.
**************************************
Private Sub SendTask()
Dim outlookApp As Outlook.Application
Dim outlookTask As Outlook.TaskItem
Set outloopApp = CreateObject("Outlook.application")
Set outlookTask = outlookApp.CreateItem(olTaskItem) ' here is the error message.
With outlookTask
.Subject = "Reminder for Task ID: " & Me.txtTicketID
.Body = "This is a reminder from your Task List with the due date: " & txtDueDte
.ReminderSet = True
.DUEDATE = Me.txtDueDte
.ReminderTime = Me.txtDueDate - 1 & " 9.30 A.M."
.Save
End With
MsgBox "Task has been set in Outlook sucessfully.", vbInformation, "Set Task Confirmed"
End Sub
Run time error: 91;
Object variable or with block variable not set
Thank you.
**************************************
Private Sub SendTask()
Dim outlookApp As Outlook.Application
Dim outlookTask As Outlook.TaskItem
Set outloopApp = CreateObject("Outlook.application")
Set outlookTask = outlookApp.CreateItem(olTaskItem) ' here is the error message.
With outlookTask
.Subject = "Reminder for Task ID: " & Me.txtTicketID
.Body = "This is a reminder from your Task List with the due date: " & txtDueDte
.ReminderSet = True
.DUEDATE = Me.txtDueDte
.ReminderTime = Me.txtDueDate - 1 & " 9.30 A.M."
.Save
End With
MsgBox "Task has been set in Outlook sucessfully.", vbInformation, "Set Task Confirmed"
End Sub
Last edited: