ich hatte schon einen Code im Netz gefunden, der allerdings kein Erfolg brachte.
Ich bin in einem Verteiler, aus dem, warum auch immer, man nicht herausgenommen werden kann.
Ich möchte daher gern, das wenn von Person "Peter" ein Termineinladung bekomme, das dieser ohne Antwort senden abgelehnt wird.
Manchmal bekomme ich auch einen Termin im Auftrag von "Peter", auch hier ablehnen ohne Antwort.
Hat jemand evtl. einen solchen Code, oder weiß, warum der untere nicht funktioniert.
Ich weiß, das dies ein Excel Forum ist, aber vielleicht kann trotzdem jemand helfen.
Danke schön.
gefunden hatte ich mal diesen Code:
Sub CheckMailForMeetingRequest(itm As Object)
Dim app As AppointmentItem, mItem As MeetingItem
If itm.Class = olMeetingRequest And (itm.SenderName = "Peter" Or itm.SenderName = "Klaus") Then
Set app = itm.GetAssociatedAppointment(False)
If Not app Is Nothing Then
Set mItem = app.Respond(olMeetingDeclined, True, False)
mItem.Send
End If
itm.Delete
End If
End Sub
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim arrEntryIDs As Variant, objItem As Object
arrEntryIDs = Split(EntryIDCollection, ",")
For i = 0 To UBound(arrEntryIDs)
Set objItem = Application.Session.GetItemFromID(arrEntryIDs(i))
CheckMailForMeetingRequest objItem
Next
End Sub