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

Printed on: April 23, 2024 at 12:04 o'clock

Member: Dani
Dani Apr 30, 2020 at 20:14:20 (UTC)
Goto Top
Mitglied: 143728
Solution 143728 Apr 30, 2020, updated at May 03, 2020 at 11:41:00 (UTC)
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
Member: ThomasThomas
ThomasThomas May 03, 2020 at 11:25:32 (UTC)
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 May 03, 2020 at 11:41:07 (UTC)
Goto Top
s.o.
Member: ThomasThomas
ThomasThomas May 15, 2020 at 19:03:54 (UTC)
Goto Top
Danke für die schnelle Antwort