With CreateObject("Outlook.Application")
Set oOutContacts = .GetNamespace("MAPI").GetDefaultFolder(10)
With oOutContacts.Items.Add
.Lastname = XYZ
...
.Save
einen Kontakt im Outlook-Kontakteordner anlegen. Das klappt so weit auch gut ... nur nicht in dem gewünschten Kontakte-Ordner.
Ich habe zwei Konten in Outlook: mail-A@xyz.de und mail-B@xyz.de.
Für beide Konten hat Outlook je einen(Standard/Default-) Kontakte-Ordner angelegt.
Mit obigem Code wird der Kontakt im mail-A@xyz.de-Kontakte-Ordner [Name: "Kontakte (nur auf diesem Computer) mail-A@xyz.de"] abgelegt. Wie lege ich stattdessen den Kontakt im mail-B@xyz.de-Kontakte-Ordner [Name: "Kontakte (nur auf diesem Computer) mail-B@xyz.de"] ab?