Article ID: 162371
Article Last Modified on 1/19/2007
Option Explicit
Function AddOutLookTask()
Dim appOutLook As Outlook.Application
Dim taskOutLook As Outlook.TaskItem
Set appOutLook = CreateObject("Outlook.Application")
Set taskOutLook = appOutLook.CreateItem(olTaskItem)
With taskOutLook
.Subject = "This is the subject of my task"
.Body = "This is the body of my task."
.ReminderSet = True
.ReminderTime = DateAdd("n", 2, Now) ' Set to remind us 2
' minutes from now.
.DueDate = DateAdd("n", 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 Function
?AddOutLookTask()Note that a new task is added to Microsoft Outlook.
160502 ACC: Using Automation to Add Appointments to Microsoft Outlook
167223 OFF97: Microsoft Office 97 Automation Help File Available
Additional query words: OutSol OutSol97 OutSol98
Keywords: kbfaq kbinfo kbprogramming KB162371