Microsoft KB Archive/161152

= How To Add a New Appointment in Schedule Plus =

Article ID: 161152

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition

-



This article was previously published under Q161152



SUMMARY
This article demonstrates how to use Visual Basic code to add an appointment to Schedule Plus.



MORE INFORMATION
 Start a new Standard EXE project. Form1 is added by default. Add a CommandButton to Form1.  Place the following code in the General Declarations section of Form1: Option Explicit

Private Sub Command1_Click Dim objSchdPlus As Object Dim objContact As Object Dim dStartTime As Date Dim iNumHours As Integer Set objSchdPlus = CreateObject("SchedulePlus.application") objSchdPlus.Logon Set objContact = _ objSchdPlus.ScheduleSelected.SingleAppointments.New dStartTime = "01/04/96 12:15:00" iNumHours = 1 objContact.SetProperties Text:="Santa Claus", _ Start:=dStartTime, End:=DateAdd("h", _       iNumHours, dStartTime), Notes:="Booking xmas presents" objSchdPlus.Logoff End Sub  Press the F5 key to run the project, and click the CommandButton. Note that when you look at the Schedule Plus database, you see the new appointment.

NOTE: If Schedule Plus 7.0 is not running, the above code will result in run-time error 450: Wrong number of arguments or invalid property assignment.

Keywords: kbhowto kbprogramming KB161152

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.