Saving an email in .txt file

M

Michael Bauer [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top