AW: Mit Excel Outlook-Mails speichern
09.11.2018 08:42:58
Lutz
Das hier verwende ich in Outlook:
Sub SaveEmail()
Dim strPath As String
Dim strText As String
strPath = "C:\eMail\"
If TypeOf Application.ActiveWindow Is Outlook.Explorer Then
Set obj = Application.ActiveWindow
Set obj = obj.Selection(1)
Else
Set objInspector = ActiveInspector
objInspector.Activate
If objInspector.IsWordMail Then
Set obj = Application.ActiveInspector.CurrentItem
End If
End If
With obj
' Sonderzeichen ersetzen '
strText = Replace(.Subject, "/", " ")
strText = Replace(strText, "!", "")
strText = Replace(strText, ".", " ")
strText = Replace(strText, "\", " ")
strText = Replace(strText, ":", " ")
strText = Replace(strText, "(", "")
strText = Replace(strText, ")", "")
strText = Replace(strText, """", "")
.SaveAs strPath & Format(.ReceivedTime, "YYYY-MM-DD_hhmmss") & "_" & strText & ".msg", _
olMSG
End With
End Sub
Mir fehlt jetzt "nur" der Teil dadrüber, um das ganze aus Excel heraus zu starten.