Ich habe im Netz folgendes Beispiel herungergeladen:
Private Sub DisplaySenderDetails()
Dim Explorer As Outlook.Explorer
Dim CurrentItem As Object
Dim Sender As Outlook.AddressEntry
Dim Contact As Outlook.ContactItem
Set Explorer = Application.ActiveExplorer 'Hier wird ein Fehler ausgelöst
' Check whether any item is selected in the current folder.
If Explorer.Selection.Count Then
' Get the first selected item.
Set CurrentItem = Explorer.Selection(1)
' Check for the type of the selected item as only the
' MailItem object has the Sender property.
If CurrentItem.Class = olMail Then
Set Sender = CurrentItem.Sender
' There is no sender if the item has not been sent yet.
If Sender Is Nothing Then
MsgBox "There's no sender for the current email", vbInformation
Exit Sub
End If
Set Contact = Sender.GetContact
If Not Contact Is Nothing Then
' The sender is stored in the contacts folder,
' so the contact item can be displayed.
Contact.Display
Else
' If the contact cannot be found, display the
' address entry in the properties dialog box.
Sender.Details 0
End If
End If
End If
End Sub
Bei der Zeile Set Explorer = Application.ActiveExplorer wird jedoch ein Fehler ausgelöst.Ich vermuste, dass mir ein Verweis fehlt. Nur welcher?
Danke im Voraus und lg Alex