![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I need to save emails from a particular email address which has "GG123456" in
the email message as a txt file onto a my local hard disk drive. These emails have to be saved as they arrive. I have looked at message rules but cannot figure out how to save the message as a .txt file. Any help would be appreciated. Thanks Ste |
Ads |
#2
|
|||
|
|||
![]() You could use a run-a-script-rule that looks for specific words in the message body and then calls your script. That script could look like this: Public Sub SaveToFile(Mail as Outlook.MailItem) Dim Name as String Name=Mail.Subject ReplaceCharsForFileName Name, "_" Mail.SaveAs "d:\" & Name & ".txt",olTXT End Sub Private Sub ReplaceCharsForFileName(sName As String, _ sChr As String _ ) ' Replaces characters which aren't allowed for file names 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 -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Am Wed, 6 Dec 2006 07:59:01 -0800 schrieb sthana: I need to save emails from a particular email address which has "GG123456" in the email message as a txt file onto a my local hard disk drive. These emails have to be saved as they arrive. I have looked at message rules but cannot figure out how to save the message as a .txt file. Any help would be appreciated. Thanks Ste |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
outlook 2k3 Script: how to Save Mail body to txt file | news.microsoft.com | Outlook and VBA | 5 | November 7th 06 03:23 PM |
How to extract multiple MIME/base64 inline parts from a *.txt file ? | Tobias Merler | Outlook - General Queries | 0 | September 5th 06 03:09 PM |
Saving an email in .txt file | Maggie Helton | Outlook and VBA | 1 | August 23rd 06 06:54 AM |
How to attach .txt file to all outgoing emails? | [email protected] | Outlook - General Queries | 1 | August 17th 06 04:22 PM |
last string in txt file | Leech | Outlook and VBA | 1 | February 10th 06 08:13 AM |