HOWTO: Create a New Contact in Schedule Plus from Visual Basic

ID: Q161343


The information in this article applies to:
  • Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, version 5.0


SUMMARY

This article demonstrates how to use Visual Basic to add a contact to Schedule Plus.


MORE INFORMATION

  1. Start a new Standard EXE project. Form1 is added by default.


  2. Add the following code to Form1's Click event procedure:
    
          Private Sub Form1_Click()
             Dim objSchdPlus As Object
             Dim objContact As Object
    
             Set objSchdPlus = CreateObject("SchedulePlus.Application")
             objSchdPlus.Logon
             Set objContact = objSchdPlus.ScheduleSelected.Contacts.New
             objContact.SetProperties FirstName:="Santa", _
                LastName:="Claus", PhoneBusiness:="(206)555-4321", _
                PhoneHome:="(206)555-6789"
             objSchdPlus.Logoff
             Set objContact = Nothing
             Set objSchdPlus = Nothing
           End Sub 


  3. Start Microsoft Schedule Plus.


  4. Press the F5 key to run the program. Click the form, and then view your list of contacts in Schedule Plus to see the new entry.


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

Additional query words: OLE

Keywords : kbprg kbVBp500 kbhowto VBKBAutomation vbwin
Version : WINDOWS:5.0
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: October 25, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.