Outlook-Workshop - Kontakte aus Exceltabelle übertragen
Eine Übersicht aller Attribute mit Erklärung finden sie hier => ContactItem Properties (Outlook)
Ausschnitt Beispieltabelle:
Code:
Option Explicit
Sub Send_Contact_List()
Dim lngStartRow As Long
Dim lngLastRow As Long
Dim olApp As Object
Set olApp = CreateObject("Outlook.Application")
lngLastRow = Worksheets("Tabelle1").Range("A" & Rows.Count).End(xlUp).Row
For lngStartRow = 2 To lngLastRow
With olApp.CreateItem(2)
.LastName = Cells(lngStartRow, 1).Value
.FirstName = Cells(lngStartRow, 2)
.CompanyName = Cells(lngStartRow, 3)
.HomeAddressStreet = Cells(lngStartRow, 4)
.HomeAddressPostalCode = Cells(lngStartRow, 5)
.HomeAddressCity = Cells(lngStartRow, 6)
.Email1Address = Cells(lngStartRow, 7)
.HomeTelephoneNumber = Cells(lngStartRow, 8)
.Home2TelephoneNumber = Cells(lngStartRow, 9)
.MobileTelephoneNumber = Cells(lngStartRow, 10)
.Body = Cells(lngStartRow, 11)
.Save
End With
Next lngStartRow
End Sub