![]() |
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
|
|||
|
|||
![]()
Hi-
I'd like to burn about 150 e-mails in a folder to a CD. I'm looking for some code that will loop through 1 folder and save each e-mail as a *.htm file into a folder on my desktop. Then I'll burn those htm files to the CD. If an e-mail has an attachment, it can be disregarded. Thanks your for help Jason Outlook 2003, WinXP |
Ads |
#2
|
|||
|
|||
![]()
Try this macro:
Sub SaveEmailsToDisk() On Error Resume Next Dim objNS As Outlook.NameSpace Dim objFolder As Outlook.MAPIFolder, objItems As Outlook.Items Dim objItem As Object Dim strSavePath As String, objMailItem As Outlook.MailItem Set objNS = Application.GetNamespace("MAPI") 'Select folder containing e-mails Set objFolder = objNS.PickFolder If objFolder Is Nothing Then Exit Sub strSavePath = "C:\Temp" 'FIND ALL E-MAIL MESSAGES IN THE CURRENT FOLDER Set objItems = objFolder.Items For Each objItem In objItems If objItem.Class = olMail Then If objItem.Attachments.Count = 0 Then 'only process e-mails without attachments Set objMailItem = objItem 'Be wary of invalid file name characters in Subject line! objMailItem.SaveAs strSavePath & objMailItem.Subject & ".htm", OlSaveAsType.olHTML End If Set objMailItem = Nothing Set objItem = Nothing End If Next Set objItems = Nothing Set objFolder = Nothing Set objNS = Nothing End Sub -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Jason Morin" wrote: Hi- I'd like to burn about 150 e-mails in a folder to a CD. I'm looking for some code that will loop through 1 folder and save each e-mail as a *.htm file into a folder on my desktop. Then I'll burn those htm files to the CD. If an e-mail has an attachment, it can be disregarded. Thanks your for help Jason Outlook 2003, WinXP |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
can I save addresses to my Personal Folder instead of Contacts | LeicesLad | Outlook - Using Contacts | 8 | September 27th 06 04:48 PM |
Doesnt save in Send Folder | bill | Outlook Express | 3 | April 3rd 06 10:21 PM |
auto save attachment to specific folder | John 3:16 | Outlook and VBA | 1 | March 27th 06 09:00 PM |
How do I save emails in Activities folder? | Sue Mosher [MVP-Outlook] | Outlook - Using Contacts | 4 | January 19th 06 05:25 PM |
Save to folder no longer remembered | JustMe | Outlook Express | 6 | January 12th 06 11:13 PM |