Warum das nützlich ist
Weil Du morgens nicht durch 57 E-Mails klicken willst.
Und weil der Chef fragt: „Was war denn heute los?“
Ein automatisierter Bericht zeigt Dir auf einen Blick:
Was kam rein, von wem, mit welchem Betreff – sauber formatiert.
Als Word oder Excel. Per VBA aus Outlook Classic.
Ziel
Ein Bericht wie dieser:
Uhrzeit | Absender | Betreff |
---|---|---|
08:23 | meier@firma.de | Anfrage zum Vertrag |
09:07 | support@kunde.de | Rückfrage zur Lieferung |
11:42 | info@messe.de | Einladung zur Veranstaltung |
Exportiert als .docx
oder .xlsx
. Auf Wunsch automatisch jeden Abend.
Schritt 1: Mails aus dem Posteingang filtern (heute)
Function HoleHeuteEingang() As Collection
Dim outlookApp As Outlook.Application
Set outlookApp = Outlook.Application
Dim ns As Outlook.NameSpace
Set ns = outlookApp.GetNamespace("MAPI")
Dim inbox As Outlook.Folder
Set inbox = ns.GetDefaultFolder(olFolderInbox)
Dim mail As Object
Dim result As New Collection
Dim today As Date
today = Date
For Each mail In inbox.Items
If TypeOf mail Is Outlook.MailItem Then
If Int(mail.ReceivedTime) = today Then
result.Add mail
End If
End If
Next
Set HoleHeuteEingang = result
End Function
Schritt 2: Bericht als Word-Datei erzeugen
Sub BerichtAlsWord()
Dim mails As Collection
Set mails = HoleHeuteEingang()
Dim wdApp As Object
Dim wdDoc As Object
Set wdApp = CreateObject("Word.Application")
Set wdDoc = wdApp.Documents.Add
wdDoc.Content.InsertAfter "Tagesbericht – Eingänge " & Format(Date, "dd.mm.yyyy") & vbCrLf & vbCrLf
Dim mail As Object
Dim i As Long
For i = 1 To mails.Count
Set mail = mails(i)
wdDoc.Content.InsertAfter _
Format(mail.ReceivedTime, "hh:mm") & " | " & _
mail.SenderEmailAddress & " | " & _
mail.Subject & vbCrLf
Next
wdDoc.SaveAs2 Environ("USERPROFILE") & "\Desktop\Tagesbericht_" & Format(Date, "yyyymmdd") & ".docx"
wdApp.Visible = True
End Sub
Schritt 3: Bericht als Excel-Datei erzeugen
Sub BerichtAlsExcel()
Dim mails As Collection
Set mails = HoleHeuteEingang()
Dim xlApp As Object
Dim xlBook As Object
Dim xlSheet As Object
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Sheets(1)
xlSheet.Cells(1, 1).Value = "Uhrzeit"
xlSheet.Cells(1, 2).Value = "Absender"
xlSheet.Cells(1, 3).Value = "Betreff"
Dim mail As Object
Dim i As Long
For i = 1 To mails.Count
Set mail = mails(i)
xlSheet.Cells(i + 1, 1).Value = Format(mail.ReceivedTime, "hh:mm")
xlSheet.Cells(i + 1, 2).Value = mail.SenderEmailAddress
xlSheet.Cells(i + 1, 3).Value = mail.Subject
Next
xlBook.SaveAs Environ("USERPROFILE") & "\Desktop\Eingangsbericht_" & Format(Date, "yyyymmdd") & ".xlsx"
xlApp.Visible = True
End Sub
Erweiterungsideen
- Gruppieren nach Absender-Domain
- Summieren pro Kategorie oder Betreff-Stichwort
- GPT-Analyse: „Was war wichtig, was war doppelt?“
- Automatisierter Versand des Berichts (z. B. 18:00 Uhr per Task)
Was Du beachten musst
- Bei sehr vielen Mails dauert’s – Outlook-Objektmodell ist nicht schnell
- Zeitzonen und Filter (heute) ggf. anpassen
- Formatierung in Word oder Excel kannst Du frei gestalten
- Der Desktop ist als Speicherort bequem – kann aber angepasst werden
„Du kannst lesen – aber VBA kann Dir zeigen, was wichtig war.“
Wenn Du sowas täglich brauchst – ich automatisier Dir den Bericht.
Du liest nur noch das PDF. Fertig.
Keine Antworten