Task Reminders Not Working With CDO

B

Brian Daoust

Hello everyone,

I am trying to write VBA code that sends a task request to a user on
our Exchange Box. I also want to send a reminder. I've done alot of
reading, and came up with the code I am posting with this message.

The tasks reminders are not working. When I send the task, the user
accepts the task, becomes the owner, and the dates look all fine.
However, the reminder option is not checked on their Outlook for that
particular task.

Also, can you assign a task to multiple people?

Here is what I am trying to accomplish.

I wrote a Contract system that keeps track of all of the company's
contracts. I have an "Reminder" button that sends a task request to a
select user so they can be reminded that the contract is about to
expire. Ideally, the reminder should be able to be set for weeks,
days, months in advance.

Help would be appreicated. Here is the code:

Thanks in advance,

Private Sub Command3_Click()
Dim olApp As Outlook.Application
Dim Inbox As Outlook.MAPIFolder
Dim objItem As Object
Dim dteDueDate As Date
Dim objTask As Outlook.TaskItem
Dim taskOutLook As Outlook.TaskItem

Set olApp = CreateObject("Outlook.Application")
Set Inbox = olApp.GetNamespace("Mapi").GetDefaultFolder(olFolderTasks)

Set objTask = Inbox.Items.Find("[Subject] = Contract Reminder CLS
Support")

If objTask Is Nothing Then ' No Match
Set taskOutLook = olApp.CreateItem(olTaskItem)
taskOutLook.Assign
taskOutLook.Recipients.Add ("(e-mail address removed)")
taskOutLook.Subject = "Contract Reminder CLS Support"
taskOutLook.Body = "This entry was automatically sent by
the Canyon Ranch Contract Application." & _
vbCrLf & "Contract Name: CLS Support" & vbCrLf & "Summary:
CLS Maintenance Support"
taskOutLook.ReminderSet = True
taskOutLook.ReminderTime = #7/29/2003 07:00 AM#


taskOutLook.DueDate = "08/29/2003"

taskOutLook.ReminderPlaySound = True

taskOutLook.ReminderSoundFile = "C:\Program
Files\Microsoft Office\Office\reminder.wav"
taskOutLook.Save
taskOutLook.Send

Else ' Note discard Else Code - this is for updating tasks
objTask.DueDate = "10/10/2003"
objTask.Save
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top