mjelec
asked on
Move an email from outlook to a local folder
I am trying to move an email from an outlook folder to a local folder on my C drive, but i suspect that i am doing it wrong.
Dim ol As New Outlook.Application
Dim olns As Outlook.NameSpace
Dim mf As Outlook.MAPIFolder
Dim m As Outlook.MailItem
Dim destfolder As String
Set m = mf.Items.Item(i)
destfolder = "c:\test"
m.Move destfolder
What am I doing wrong?
Dim ol As New Outlook.Application
Dim olns As Outlook.NameSpace
Dim mf As Outlook.MAPIFolder
Dim m As Outlook.MailItem
Dim destfolder As String
Set m = mf.Items.Item(i)
destfolder = "c:\test"
m.Move destfolder
What am I doing wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Wait I missed the File name part, it works.
ASKER
"Cannot write to file: C:\test. Right-click the folder that contains the file you want to, and then click the properties on the shortcut menu to check your permissions for the folder."
I cant seem to find any properties, this is just a folder on my c: drive. I am using the code:
destfolder = "c:\test"
m.SaveAs destfolder, olMSG