ich habe mir die folgende Programmierung von Ramses aus dem Forum "gesaugt", komme jetzt aber nicht weiter:
Sub Read_Contact_from_Outlook()
'by Ramses
'Liest alle Kontakte aus Outlook in das aktuelle Tabellenblatt
Dim myOlk As Object
Dim myOlkContact As Object
Dim iCounter As Integer, i As Integer
Dim workingFolder
Set myOlk = CreateObject("outlook.application")
Set myOlkContact = myOlk.CreateItem(olContactItem)
Sheets(1).Select
Cells.Select
Selection.ClearContents
Range("c2").Select
For Each myOlkContact In myOlk.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items
With myOlkContact
ActiveCell.Value = .Email1Address
ActiveCell.Offset(0, 1).Value = .LastName
ActiveCell.Offset(0, 2).Value = .FirstName
ActiveCell.Offset(0, 3).Value = .Title
ActiveCell.Offset(0, 4).Value = .MobileTelephoneNumber
ActiveCell.Offset(0, 5).Value = .Birthday
ActiveCell.Offset(0, 6).Value = .Categories
ActiveCell.Offset(0, 7).Value = .HomeAddressStreet
ActiveCell.Offset(0, 8).Value = .HomeAddressPostalCode
ActiveCell.Offset(0, 9).Value = .HomeAddressCity
ActiveCell.Offset(0, 10).Value = .HomeAddressCountry
ActiveCell.Offset(0, 11).Value = .HomeAddressState
etc etc.....
Die Infos aus Outlook werden so prima in Sheets(1)eingelesen.
Nun lese ich über eine Listbox alle (theoretisch) verfügbaren Datenfelder (.LastName, .FirstName etc) ein und nach 'multiselect'-Klicks wird die Auswahl des Users (z. B. .LastName, .birthday etc) nach Sheets(2) A1 bis A10 geschrieben.
Über diese variable Auswahl (also Inhalt von A1 bis A10) sollen dann die Kontakte aus Outlook importiert werden.
Ersetzte ich in der obigen Programmierung z. B. das Feld .LastName durch eine Variable, die den Wert von A1 zugewiesen bekommen hat, erscheint nach Import aus Outlook nicht der Wert aus dem Outlook-Kontakt, sondern der Inhalt von Zelle A1 (für Profis sicherlich logisch).
Wie könnte die Lösung aussehen? Vielen Dank für Eure Tipps....
Matthias_FFM