Saving an email in .txt file

  • Thread starter Thread starter Guest
  • Start date Start date
Am Tue, 22 Aug 2006 12:31:03 -0700 schrieb Maggie Helton:

You can create a run-a-script-rule and call this sample:

Public SaveAsText(Mail as Outlook.MailItem)
Dim Path as String
Dim File as String

Path = "d:\"
File = Mail.Subject & "_" & Mail.ReceivedTime
ReplaceCharsForFileName File, "_"
Mail.Save File, olTXT
End Sub


Private Sub ReplaceCharsForFileName(sName As String, _
sChr As String _
)
' Ersetzt in Dateinamen unerlaubte Zeichen
sName = Replace(sName, "/", sChr)
sName = Replace(sName, "\", sChr)
sName = Replace(sName, ":", sChr)
sName = Replace(sName, "?", sChr)
sName = Replace(sName, Chr(34), sChr)
sName = Replace(sName, "<", sChr)
sName = Replace(sName, ">", sChr)
sName = Replace(sName, "|", sChr)
End Sub

If you´d get two messages with the same subject and the same time then the
second would overwrite the first one.
 
Back
Top