![]() |
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |