thomasthomas
Goto Top

Outlook Betreff bei eintreffender Email ändern

Hallo,

wie kann man mit einem Makro den Betreff einer eintreffenden Email ändern.

Beispiel:

2020_04_30 Beispiel Betreff

ändern in:

x_2020_04_30 Beispiel Betreff

Danke

Grüße Thomas

Content-Key: 568715

Url: https://administrator.de/contentid/568715

Ausgedruckt am: 29.03.2024 um 00:03 Uhr

Mitglied: Dani
Dani 30.04.2020 um 22:14:20 Uhr
Goto Top
Mitglied: 143728
Lösung 143728 30.04.2020, aktualisiert am 03.05.2020 um 13:41:00 Uhr
Goto Top
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
    Dim varEntryIDs, objItem As Object, i As Integer
    ' EntryIDCollection liegt als String getrennt mit Komma vor, trenne diese in ein Array  
    varEntryIDs = Split(EntryIDCollection, ",")  
     ' Für jede eingetroffene Mail ...  
    For i = 0 To UBound(varEntryIDs)
        ' hole das Mailobject anhand der ID  
        Set objItem = Application.Session.GetItemFromID(varEntryIDs(i))
        ' wenn der Typ des Objects einer Mail entspricht  
        If objItem.Class = olMail Then
            ' ändere Subject  
            objItem.Subject = "x_" & objitem.Subject  
            ' und speichere die Mail ab  
            objitem.Save
        End if
    Next
End Sub
Mitglied: ThomasThomas
ThomasThomas 03.05.2020 um 13:25:32 Uhr
Goto Top
Vielen Dank cabrinha, funktioniert super.

Kannst du kurz die Zeilen kommentieren was da passiert? Kann es nicht 100% nachvollziehen.

Danke
Mitglied: 143728
143728 03.05.2020 um 13:41:07 Uhr
Goto Top
s.o.
Mitglied: ThomasThomas
ThomasThomas 15.05.2020 um 21:03:54 Uhr
Goto Top
Danke für die schnelle Antwort