Es liest auf einen Beliebigen Adressbuch die Adressen aus und gibt sie in ein Excel-Blatt ein. Schön. Gut so.
Ich möchte aber, dass man zuerst die Adresse auswählen kann (vielleicht sogar über Suchmodus) und dan nur die eine Adresse in ein Textfeld (TextBox1) eingelesen wird, das sich auf meinem Formular befindet.
Mein Problem: Ich habe keine blassen Schimmer eine schwachen Ahnung, wie das geht, da ich mich mit Formularen so gut wie gar nicht auskenne...
Wäre Toll, wenn mit ein Excel-Profi etwas weiterhelfen könnte!
Mit freundlichen Grüssen
Rolf
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("Partner-Adressen")
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