Does anyone have a solution to save email messages from your Outlook inbox and save a copy to your hard drive or network folder and then move the email message to a different folder in Outlook.
This is the code I have so far, but I get errors on the SaveAs line.
Sub CopyEmailMsg()
Set myApp = New Outlook.Application
Set myNS = myApp.GetNamespace("MAPI"
Set myFolder = myNS.GetDefaultFolder(olFolderInbox)
Set myDestFolder = myFolder.Folders("test"
For Count = 1 To myFolder.Items.Count
Set myMail = myFolder.Items(Count)
myMail.SaveAs "C:\My Documents\email\" & myMail.Subject & ".msg", olMSG
myMail.Move myDestFolder
myMail.Delete
Next Count
MsgBox "The email has been copied"
End Sub
Thanks for the feedback
This is the code I have so far, but I get errors on the SaveAs line.
Sub CopyEmailMsg()
Set myApp = New Outlook.Application
Set myNS = myApp.GetNamespace("MAPI"
Set myFolder = myNS.GetDefaultFolder(olFolderInbox)
Set myDestFolder = myFolder.Folders("test"
For Count = 1 To myFolder.Items.Count
Set myMail = myFolder.Items(Count)
myMail.SaveAs "C:\My Documents\email\" & myMail.Subject & ".msg", olMSG
myMail.Move myDestFolder
myMail.Delete
Next Count
MsgBox "The email has been copied"
End Sub
Thanks for the feedback