Gruppe
Extern
Problem
Die Geschäftstelefonangabe des in Zelle B2 genannten Email-Kontakts soll editiert werden.
StandardModule: Modul1
Sub ContactEdit()
Dim oOL As Object
Dim olNS As Object
Dim fdContacts As Object
Dim fdItems As Object
Dim fdItem As Object
Set oOL = CreateObject("Outlook.Application")
Set olNS = oOL.GetNamespace("MAPI")
Set fdContacts = olNS.GetDefaultFolder(olFolderContacts)
Set fdItems = fdContacts.Items
Set fdItem = fdItems(Range("B1").Value)
On Error GoTo ERRORHANDLER
fdItem.BusinessTelephoneNumber = Range("B2").Value
fdItem.Save
ERRORHANDLER:
Set fdItem = Nothing
Set fdItems = Nothing
Set fdContacts = Nothing
Set olNS = Nothing
Set oOL = Nothing
End Sub