Macro to automate the Move to Folder command

Last reviewed on February 12, 2014

An Outlook user had a problem: delegates drafted messages for their managers and needed to save them in the manager's Drafts folder.

If the delegate creates a Draft email (not sent yet) and wants to save it in the manager's Draft folder, there is no easy way to do that. It automatically saves in the Delegate's Drafts folder by default. We tried moving it from the delegate's folder to the manager's folder, but then the manager does not have access to edit it. So we had to copy it, and then delete the copy from the Delegate's folder. This is crazy as it involved many more steps and is not efficient.

They discovered they could use the Move to Folder command to save the Drafts in the manager's Drafts folder and save a few steps. While the Move to Folder command is easy to use, especially when the folder you want to move to is on the MRU list, you can save a step or two by using a macro to move the draft.

Shared mailbox names in the folder listTo use this macro, paste it into a module in the VB Editor then change the Destination folder name. Use the mailbox or data file name as it appears in your folder list; Exchange server mailboxes will use the display name as seen in the GAL.

ribbon buttonOpen a new message form and customize the ribbon or QAT by creating a button for the macro.

Create a draft message then click the button to move it to another folder.

Move to a folder macro

Sub MoveDraftMail()
    Dim objOutlook As Outlook.Application
    Dim objNamespace As Outlook.NameSpace
    Dim objSourceFolder As Outlook.MAPIFolder
    Dim objDestFolder As Outlook.MAPIFolder
    Dim objItem As MailItem
    Set objOutlook = Application
    Set objNamespace = objOutlook.GetNamespace("MAPI")
    Set objSourceFolder = objNamespace.GetDefaultFolder(olFolderDrafts)
    Set objItem = objOutlook.ActiveInspector.currentItem    
    Set objDestFolder = objNamespace.Folders("Mary Reaser").Folders("Drafts")
    objItem.Move objDestFolder
    Set objDestFolder = Nothing
End Sub

Customize the macro

You can use this macro with other Outlook item types by changing the objItem and folder names. For example, I want to save contacts in my Sharepoint list, so I changed three lines to the following:

Dim objItem As ContactItem

Set objSourceFolder = objNamespace.GetDefaultFolder(olFolderContacts)

Set objDestFolder = objNamespace.Folders("SharePoint Lists").Folders("SPS - Contacts")

To use the currently selected folder as the source folder, use
Set objSourceFolder = objNamespace.ActiveExplorer.CurrentFolder

Dim objItem As Item Type
GetDefaultFolder types
olFolderManagedEmail (Exchange only)
olPublicFoldersAllPublicFolders (Exchange only)


Please note, the user needs to have at least Create permission on the folder they are moving the item to. If the folder is in another person's mailbox, the folder (or the mailbox) needs to be open in Outlook as a shared folder or mailbox.

Give the delegate Author permission on the Drafts folder

How to use macros

First: You will need macro security set to low during testing.

To check your macro security in Outlook 2010 or 2013, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, it’s at Tools, Macro Security.

After you test the macro and see that it works, you can either leave macro security set to low or sign the macro.

Open the VBA Editor by pressing Alt+F11 on your keyboard.

To put the code in a module:

  1. Right click on Project1 and choose Insert > Module
  2. Copy and paste the macro into the new module.

More information as well as screenshots are at How to use the VBA Editor

Written by

Diane Poremsky
A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

If the Post Coment button disappears, press your Tab key.