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
Set A Reference To The MS Outlook Object Library
VB Code:
Private o1 As Outlook.Application
Private Function CreateContact(Name As String, Nick As String, Email As String, Optional Folder As Outlook.MAPIFolder = Nothing) As Outlook.ContactItem
'Create a new contact item
If Folder Is Nothing Then
Set CreateContact = o1.CreateItem(olContactItem)
Else
Set CreateContact = Folder.Items.Add(olContactItem)
End If
'Set a few of the many possible contact parameters.
CreateContact.FullName = "Name"
CreateContact.NickName = "NickName"
CreateContact.Email1Address = "Email"
'Commit the contact
CreateContact.Save
End Function