Delete a contact from Outlook : Outlook Contact « Outlook « VBA / Excel / Access / Word






Delete a contact from Outlook

 
Sub DeleteaContact()
   Dim myOutlook As Outlook.Application
   Dim myInformation As Namespace
   Dim myContacts As Items
   Dim myItems As ContactItem

   Set myOutlook = CreateObject("Outlook.Application")
   Set myInformation = myOutlook.GetNamespace("MAPI")
   Set myContacts = myInformation.GetDefaultFolder(olFolderContacts).Items

   For Each myItems In myContacts
      If myItems.Email1Address = "j@yoursite.com" Then
         myItems.Delete
       End If
     Next
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.Create Outlook.Application
4.add a contact through VBA
5.Add recipient