Emailadress in globalem Adressbuch ?
08.12.2017 14:04:30
Pasci
Ich hoffe, jemand von Euch Profis hier kann mir weiterhelfen ?
und zwar such ich nach einer Möglichkeit, per Makro zu überprüfen, ob alle Email-Adressen, welche ich in einer Excel-Tabelle aufgelistet habe im globalen Adressbuch der Firma vorhanden sind ?
Geht das ?
ich habe da mal mittels Google ein wenig recherchiert und folgenden Code gefunden:
Public Function CheckMail(ByVal strEmail As String) As Boolean
Dim objApp As Object
Dim objList As Object
Dim objEntry As Object
Dim objProperty As Object
Dim strTemp As String
Set objApp = CreateObject("Outlook.Application")
For Each objList In objApp.Session.AddressLists
If objList.Name = "Globales Adressbuch" Then
For Each objEntry In objList.AddressEntries
Set objProperty = objEntry.PropertyAccessor
strTemp = objProperty.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x39FE001E")
If LCase(strTemp) = LCase(strEmail) Then
CheckMail = True
Exit For
End If
Next
End If
Next
Set objEntry = Nothing
Set objList = Nothing
Set objApp = Nothing
Set objProperty = Nothing
strTemp = Empty
End Function
Jetzt müsste ich nur noch wissen, wie ich den anpasse/aufrufe, damit er mir alle email-Adressen welche ich in meiner Excel-Tabelle habe (z.B. in Tabellenblatt1, Spalte A) prüft ?kann mir da jemand weiterhelfen ?
BESTEN DANK !
Pasci