' BEWARE: you must add a reference to Outlook library
' go to your project properties page
' click to References there
' click to Add button->Reference->COM->Type libraries
' find Microsoft Outlook 15.0 Object Library on that long list (or whatever number is available on your machine)
' be careful to click it TWICE: first time you just select that element from the list, and the second time click to a checkbox that appears after selecting it
' click OK at the bottom right
' this will automatically also add the reference to Microsoft Office 15.0 Object Library
' add the following imports statement
Imports Outlook = Microsoft.Office.Interop.Outlook

Module Module1

    'this program adds contacts to Outlook contact data

    'you need to have Outlook installed on your machine
    'you also need to add a reference to Microsoft.Office.Interop.Outlook in your project
    ' made by Gjuro Kladaric, 2016-07
    ' you can use this code for absoutely any (legal) purpose you want
    ' however, I do not accept any responsibilty related to such use

    ' yes, backup your .PST files first, no excuses, no crying later :-)

    ' the procedure below is written to ignore the first line of data
    Dim contacts(,) As String =
            {"Given Name", "Family Name", "email", "email2", "email3"},
            {"Ann", "Green", "ag@provider1.com", "", ""},
            {"John", "Black", "blackj@provider2.com", "johnb@company.us", ""}

    Sub Main()

        Dim app As Outlook.Application = New Outlook.Application()

        For row = 1 To contacts.GetUpperBound(0)
            Dim newContact As Outlook.ContactItem = app.CreateItem(Outlook.OlItemType.olContactItem)

                With newContact
                    Dim name As String = contacts(row, 0)
                    Dim surname As String = contacts(row, 1)
                    .FirstName = name
                    .LastName = surname
                    'If String.IsNullOrWhiteSpace(name) Then
                    '    .FullName = surname
                    'ElseIf String.IsNullOrWhiteSpace(surname) Then
                    '    .FullName = name
                    '    .FullName = surname & ", " & name
                    'End If
                    .Email1Address = contacts(row, 2)
                    .Email2Address = contacts(row, 3)
                    .Email3Address = contacts(row, 4)
                End With
            Catch ex As Exception
                MsgBox("Contact " & contacts(row, 0) & " " & contacts(row, 1) & " was not saved: " & ex.Message)
            End Try

    End Sub

End Module