Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

How to: Programmatically Add an Entry to Outlook Contacts

This example creates a new contact and enters data into the new contact.

Applies to: The information in this topic applies to application-level projects for Outlook 2013 and Outlook 2010. For more information, see Features Available by Office Application and Project Type.

Private Sub AddContact()
    Dim newContact As Outlook.ContactItem = Me.Application.CreateItem(Outlook. _
        With newContact
            .FirstName = "Jo"
            .LastName = "Berry"
            .Email1Address = "somebody@example.com"
            .CustomerID = "123456"
            .PrimaryTelephoneNumber = "(425)555-0111"
            .MailingAddressStreet = "123 Main St."
            .MailingAddressCity = "Redmond"
            .MailingAddressState = "WA"
        End With 
        MsgBox("The new contact was not saved.")
    End Try 
End Sub
© 2015 Microsoft