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

Save incoming Email as .html file with name of subject line



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 22nd 10, 03:00 PM posted to microsoft.public.outlook.program_vba
Matt
external usenet poster
 
Posts: 119
Default Save incoming Email as .html file with name of subject line

Hello all!

I am using the below code to save all incoming emails as an XML file. The
problem is that a new incoming email overwrites the previous one. What I'd
like to do is name the XML file as the subject line of the incoming email.
Would someone please help me?

Sub saveemail(myItem As Outlook.MailItem)
myItem.SaveAs "c:\mail\test.XML", olXML
End Sub

Matt

Ads
  #2  
Old May 22nd 10, 04:29 PM posted to microsoft.public.outlook.program_vba
Matt
external usenet poster
 
Posts: 119
Default Save incoming Email as .html file with name of subject line

Never mind...... I was able to do it. In case anyone else need to know how:

Sub saveemail(myItem As Outlook.MailItem)
myItem.SaveAs "c:\mail\" & myItem.Subject & ".xml", olXML
End Sub

Thanks All!

"Matt" wrote:

Hello all!

I am using the below code to save all incoming emails as an XML file. The
problem is that a new incoming email overwrites the previous one. What I'd
like to do is name the XML file as the subject line of the incoming email.
Would someone please help me?

Sub saveemail(myItem As Outlook.MailItem)
myItem.SaveAs "c:\mail\test.XML", olXML
End Sub

Matt

  #3  
Old May 27th 10, 10:27 PM posted to microsoft.public.outlook.program_vba
Chris
external usenet poster
 
Posts: 280
Default Save incoming Email as .html file with name of subject line

Matt:

You might want to add either ReceivedTime(Emails) or CreationTime(Reports)

Yoru code would look like:
myItem.SaveAs "c:\mail\" & myItem.Subject & "_" & myItem.ReceivedTime &
".xml", olXML

As I have discovered, you may need to scrub the subject and time of any
illegal characters such as "/", ":", or "*" etc.

Chris

"Matt" wrote:

Never mind...... I was able to do it. In case anyone else need to know how:

Sub saveemail(myItem As Outlook.MailItem)
myItem.SaveAs "c:\mail\" & myItem.Subject & ".xml", olXML
End Sub

Thanks All!

"Matt" wrote:

Hello all!

I am using the below code to save all incoming emails as an XML file. The
problem is that a new incoming email overwrites the previous one. What I'd
like to do is name the XML file as the subject line of the incoming email.
Would someone please help me?

Sub saveemail(myItem As Outlook.MailItem)
myItem.SaveAs "c:\mail\test.XML", olXML
End Sub

Matt

  #4  
Old May 27th 10, 11:47 PM posted to microsoft.public.outlook.program_vba
Matt
external usenet poster
 
Posts: 119
Default Save incoming Email as .html file with name of subject line

Hey Chris,

Good Idea!

Thanks

Matt

"Chris" wrote:

Matt:

You might want to add either ReceivedTime(Emails) or CreationTime(Reports)

Yoru code would look like:
myItem.SaveAs "c:\mail\" & myItem.Subject & "_" & myItem.ReceivedTime &
".xml", olXML

As I have discovered, you may need to scrub the subject and time of any
illegal characters such as "/", ":", or "*" etc.

Chris

"Matt" wrote:

Never mind...... I was able to do it. In case anyone else need to know how:

Sub saveemail(myItem As Outlook.MailItem)
myItem.SaveAs "c:\mail\" & myItem.Subject & ".xml", olXML
End Sub

Thanks All!

"Matt" wrote:

Hello all!

I am using the below code to save all incoming emails as an XML file. The
problem is that a new incoming email overwrites the previous one. What I'd
like to do is name the XML file as the subject line of the incoming email.
Would someone please help me?

Sub saveemail(myItem As Outlook.MailItem)
myItem.SaveAs "c:\mail\test.XML", olXML
End Sub

Matt

 




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
Outlook: save HTML message into a single HTML file? Mr. Burns Outlook - General Queries 1 June 1st 09 02:43 PM
Save Email message as HTML file on Harddrive TerryM Outlook and VBA 8 November 17th 08 07:05 PM
save Email as HTML file with embedded pictures after udpdate HTMLbody Oliv' Outlook and VBA 8 February 5th 07 11:33 AM
How do I script to change the subject line of incoming mail? D-Man Outlook and VBA 3 January 29th 07 08:12 PM
SaveAsFile - save as subject line instead of DisplayName iamjbunni Outlook and VBA 1 April 30th 06 09:54 AM


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


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