Creating Contacts

The Contacts table on the Schedule object contains all the information about a contact. After you create a contact, you can link tasks to it. Tasks linked to a contact can be thought of as belonging to that contact.

    To create a contact
  1. Get the Contacts table from the global Schedule object.
  2. Use the New method to create a new item in the Contacts table.
  3. Set the desired properties on the item.
  4. Release the objects.

The following sample code creates a new item in the Contacts table and sets several properties:

Sub CreateContact()
    Dim objTable As Object, objItem As Object
    
    'Get the Contacts table from the global Schedule object.
    Set objTable = gobjSchedule.Contacts
    
    'Create a new item in the Contacts table.
    Set objItem = objTable.New
    
    'Set the desired properties on the item.
    objItem.SetProperties FirstName:="First", LastName:="Last", _
        Notes:="Notes",PhoneBusiness:="206-555-1212", _
        PhoneFax:="206-93-MS-FAX"
    
    'Release the objects.
    Set objItem = Nothing
    Set objTable = Nothing
End Sub