Freedom Computers

ACCESS

Assign a Task to Outlook
Posted by Brixham Mike at 17:23, November 10 2013.

Private Sub Command19_Click()

Dim appOutLook As Outlook.Application
Dim taskOutLook As Outlook.TaskItem
Set appOutLook = CreateObject("Outlook.Application")
Set taskOutLook = appOutLook.CreateItem(olTaskItem)
subj = Me![first name]

With taskOutLook

.Subject = Me![first name] '"This is the subject of my task"
.Body = "This is the body of my task."
.ReminderSet = True

.ReminderTime = DateAdd("d", 5, Now) ' Set to remind us 2
' minutes from now.

.StartDate = DateAdd("d", 4, Now)
.DueDate = DateAdd("d", 5, Now) ' Set the due date to
' 5 minutes from now.

.ReminderPlaySound = True
'add the path to a .wav file on your computer.
.ReminderSoundFile = "C:\Win95\media\ding.wav"
.Save
End With
End Sub