ist es mittels vba möglich das per buttondruck auf einer Exceltabelle alle Outlook kontakte auf dieses Tabellenblatt zu importieren?
wie könnte solch ein vba Makro aussehen?
gruß
selo
Sub OL2XL()
Dim objOutlook As Object
Dim objAddressList As Object
Dim objAddressEntry As Object
Dim intCounter As Integer
Dim bln As Boolean
Application.ScreenUpdating = False
bln = Application.DisplayStatusBar
Application.DisplayStatusBar = True
Set objOutlook = CreateObject("Outlook.Application")
Set objAddressList = _
objOutlook.Session.AddressLists("Kontakte")
intCounter = 1
For Each objAddressEntry In objAddressList.AddressEntries
intCounter = intCounter + 1
If intCounter Mod 10 = 0 Then
Application.StatusBar = _
"Lese Adresse Nr. " & intCounter & " ein..."
End If
Cells(intCounter, 1) = objAddressEntry.Name
Cells(intCounter, 2) = objAddressEntry.Address
Next objAddressEntry
Set objAddressList = Nothing
Set objAddressEntry = Nothing
Set objOutlook = Nothing
Application.DisplayStatusBar = bln
Application.StatusBar = False
Application.ScreenUpdating = True
End
Sub