How to backup and save your Outlook VBA macros

Last reviewed on May 22, 2013

Applies to: Microsoft Outlook 2010, Outlook 2007, outlook 2003 and older

After you create a VBA macro in Outlook, how do you back it up, save a copy, or copy it to a new computer?

There are three ways to make a copy of your macros:

Method 1

Copy the contents of ThisOutlookSession (and any modules) and paste into notepad, saving the macro(s) as a text file.

Export VBAPorject or modules to back them upMethod 2

Right click on ThisOutlookSession and choose Export File. You'll need to do for each module (if any) in your Project.

Method 3

Close Outlook and locate the VBAProject file. Copy it to make a backup.

In Windows 7, 8, or Vista, paste %appdata%\microsoft\outlook in the address bar of Windows Explorer and press Enter to jump to the C:\Users\username\AppData\Roaming\Microsoft\Outlook folder where VBAProject.OTM is. Copy it to make a backup.

In Windows XP, paste %USERPROFILE%\Application Data\Microsoft\Outlook in the address bar of Windows Explorer and press Enter. This will open Windows Explorer to C:\Documents and Settings\username\Application Data\Microsoft\Outlook. Copy the VBAProject.OTM file.

Which method is better? It really depends on your needs. Copying the VBAProject.OTM file insures you have everything in the project and can drop it in the Outlook folder to restore the macros. Copying the code to a text file may be easier to share with others or to copy some macros to another computer that has Outlook macros already in use.

Written by

Diane Poremsky
A Microsoft Outlook Most Valuable Professional (MVP) since 1999 and involved in IT support since 1985, Diane is the author of several books and 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.