Platform SDK: Exchange Server |
A single (nonrecurring) appointment can be created using either the SingleAppointments table or the Appointments 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 Appointments table, see Merged Tables.
To create a single appointment
The following sample code creates a SingleAppointment object and sets several properties:
Sub CreateAppt() Dim objTable As Object, objItem As Object Dim dt As Date 'Get the SingleAppointments table from the global Schedule object. Set objTable = gobjSched.SingleAppointments dt = DateAdd("d", 1, Now) 'Create a new item in the SingleAppointments table. Set objItem = objTable.New 'Set the desired properties on the item. objItem.SetProperties Text:="OLE: CreateAppt " & Now(), _ Notes:="Notes", _ Start:=DateAdd("h", 1, dt), _ End:=DateAdd("h", 2, dt) 'Release the objects. Set objItem = Nothing Set objTable = Nothing End Sub