Gruppe
Extern
Problem
Die benutzerdefinierten Funktionen in den Spalten B und C sollen Titel und Anmerkungen zum Outlooknamen aus dem Outlook-Adressbuch ermitteln.
StandardModule: Modul1
Function GetOL(sContact As String, iContact As Integer)
Dim oOl As Object
Dim oNsp As Object
Dim oFolder As Object
Dim oContact As Object
Set oOl = CreateObject("Outlook.Application")
Set oNsp = oOl.GetNamespace("MAPI")
Set oFolder = oNsp.Folders("Persönliche Ordner").Folders("Kontakte")
Set oContact = oFolder.Items(sContact)
Select Case iContact
Case 1: GetOL = oContact.Title
Case 2: GetOL = oContact.Body
End Select
Set oContact = Nothing
Set oFolder = Nothing
Set oNsp = Nothing
Set oOl = Nothing
End Function