A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Saving an email in .txt file



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 22nd 06, 08:31 PM posted to microsoft.public.outlook.program_vba
Maggie Helton
external usenet poster
 
Posts: 1
Default Saving an email in .txt file

Is there a way to create a rule that would save an email as a .txt file?
Ads
  #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?

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to attach .txt file to all outgoing emails? [email protected] Outlook - General Queries 1 August 17th 06 03:22 PM
parce txt doc to become a merge doc with email address. NannaLuvs Outlook - Using Forms 0 July 12th 06 04:26 PM
last string in txt file Leech Outlook and VBA 1 February 10th 06 08:13 AM
Problem with saving .txt attachement norhaya Outlook and VBA 4 January 12th 06 10:20 AM
Problem with saving .txt attachement Michael Bauer Outlook and VBA 3 January 11th 06 09:22 AM


All times are GMT +1. The time now is 04:25 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.