Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Saving an email in .txt file (http://www.outlookbanter.com/outlook-vba/24707-saving-email-txt-file.html)

Maggie Helton August 22nd 06 08:31 PM

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

Michael Bauer [MVP - Outlook] August 23rd 06 05:54 AM

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?



All times are GMT +1. The time now is 10:39 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com