add a contact through VBA : Outlook Contact « Outlook « VBA / Excel / Access / Word






add a contact through VBA

 
Sub AddAContact()
   Dim myOutlook As Outlook.Application
   Dim myItems As ContactItem

   Set myOutlook = CreateObject("Outlook.Application")
   Set myItems = myOutlook.CreateItem(olContactItem)

   With myItems
      .FirstName = "John"
      .LastName = "Smith"
      .Email1Address = "j@yourserver.com"
      .Save
    End With
End Sub

 








Related examples in the same category

1.Print all names from your contact list in Outlook
2.Add new contact item to Outlook
3.Delete a contact from Outlook
4.Create Outlook.Application
5.Add recipient