Platform SDK: Exchange Server |
A single (nonrecurring) task can be created using either the SingleTasks table or the Tasks table, which contains the merged contents of the single and recurring tables. Because these tables are linked together, creating an item in one table automatically creates that item in the other table. For more information on the Tasks table, see Merged Tables.
To create a single task
The following sample code creates a SingleTask object and sets several properties:
Sub CreateTask() Dim objTable As Object, objItem As Object Dim dt As Date 'Get the SingleTasks table from the global Schedule object. Set objTable = gobjSchedule.SingleTasks dt = DateAdd("d", 1, Now) 'Create a new item in the SingleTasks table. Set objItem = objTable.New 'Set the desired properties on the item. objItem.SetProperties Text:="OLE: CreateTask " & Now(), _ Notes:="Notes", _ StartDate:=LConvertTo32bitDate(DateAdd("d", 1, dt)), _ EndDate:=LConvertTo32bitDate(DateAdd("d", 2, dt)) 'Release item object Set objItem = Nothing 'Release table object Set objTable = Nothing End Sub