Results 1 to 2 of 2

Thread: Creating Outlook Contacts

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    12

    Creating Outlook Contacts

    I have a project which requires creating and possibly modifying a large number of contacts. I'm planning on taking the name and e-mail address for each contact from a text file. Does anyone know how to use either VB or VBscript to create a contact? How about modifying a contact?

    Thanks

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Set A Reference To The MS Outlook Object Library

    VB Code:
    1. Private o1 As Outlook.Application
    2.  
    3. Private Function CreateContact(Name As String, Nick As String, Email As String, Optional Folder As Outlook.MAPIFolder = Nothing) As Outlook.ContactItem
    4.    'Create a new contact item
    5.     If Folder Is Nothing Then
    6.         Set CreateContact = o1.CreateItem(olContactItem)
    7.     Else
    8.         Set CreateContact = Folder.Items.Add(olContactItem)
    9.     End If
    10.     'Set a few of the many possible contact parameters.
    11.     CreateContact.FullName = "Name"
    12.     CreateContact.NickName = "NickName"
    13.     CreateContact.Email1Address = "Email"
    14.     'Commit the contact
    15.     CreateContact.Save
    16. End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width