Outlook - How to Back Up emails in Outlook 2010
Asked By Rajender Prasad on 26-Jan-12 04:17 AM
I receive many emails everyday from different senders.
I have set some rules to some senders where all the realted mails will go into specific folder in inbox.
Now, I need to drop all those emails to D:\ drive after running a rule or by using any Macro.
Please help me.
D Company replied to Rajender Prasad on 26-Jan-12 04:24 AM
here is macro to move to take outlook backup
On Error Resume Next
Dim ns As Outlook.NameSpace
Dim moveToFolder As Outlook.MAPIFolder
Dim objItem As Outlook.MailItem
Set ns = Application.GetNamespace("MAPI")
'Define path to the target folder
Set moveToFolder = ns.Folders("Mailbox - Jim Merrell").Folders("@Filed")
If Application.ActiveExplorer.Selection.Count = 0 Then
MsgBox ("No item selected")
If moveToFolder Is Nothing Then
MsgBox "Target folder not found!", vbOKOnly + vbExclamation, "Move Macro Error"
For Each objItem In Application.ActiveExplorer.Selection
If moveToFolder.DefaultItemType = olMailItem Then
If objItem.Class = olMail Then
Set objItem = Nothing
Set moveToFolder = Nothing
Set ns = Nothing
for more detail visit this link
Rajender Prasad replied to D Company on 26-Jan-12 04:32 AM
Thanks..but when I paste this code to my outlook VBA, getting an error All Macros have been disabled.
How to use this code.
second thind, where can I give my Path in this code.