View Single Post
  #2  
Old August 23rd 06, 05:54 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Saving an email in .txt file

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.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Is there a way to create a rule that would save an email as a .txt file?

Ads