---
description: At times you may wish to utilize VBA code in Outlook to achieve more functions. Yet, you do not know how to run VBA code in your Outlook. Thus, this article will expose the detailed steps to you.
title: How to Run VBA Code in Your Outlook
image: https://www.datanumen.com/blogs/wp-content/uploads/2017/10/access-file-menu.jpg
---

 

* [ ](https://www.facebook.com/DataNumen)
* [ ](http://www.linkedin.com/company/datanumen)
* [ ](https://twitter.com/DataNumen)

[Home](https://www.datanumen.com/blogs/) \> [Solutions](https://www.datanumen.com/blogs/category/solutions/) \> [Office Solutions](https://www.datanumen.com/blogs/category/solutions/office-solutions/) \> [Outlook Solutions](https://www.datanumen.com/blogs/category/solutions/office-solutions/outlook-solutions/) \> How to Run VBA Code in Your Outlook

# How to Run VBA Code in Your Outlook

[Outlook Solutions](https://www.datanumen.com/blogs/category/solutions/office-solutions/outlook-solutions/)  September 29, 2025 

Share Now: 
* [ ](https://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.datanumen.com%2Fblogs%2Frun-vba-code-outlook%2F)
* [ ](https://x.com/share?url=https%3A%2F%2Fwww.datanumen.com%2Fblogs%2Frun-vba-code-outlook%2F&text=How+to+Run+VBA+Code+in+Your+Outlook)
* [ ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fwww.datanumen.com%2Fblogs%2Frun-vba-code-outlook%2F)
* [ ](javascript:void%28%28function%28%29%7Bvar%20e=document.createElement%28'script'%29;e.setAttribute%28'type','text/javascript'%29;e.setAttribute%28'charset','UTF-8'%29;e.setAttribute%28'src','//assets.pinterest.com/js/pinmarklet.js?r='+Math.random%28%29%2A99999999%29;document.body.appendChild%28e%29%7D%29%28%29%29;)
* [ ](https://www.reddit.com/submit?url=https%3A%2F%2Fwww.datanumen.com%2Fblogs%2Frun-vba-code-outlook%2F&title=How+to+Run+VBA+Code+in+Your+Outlook)
* [ ](https://www.tumblr.com/share/link?url=https%3A%2F%2Fwww.datanumen.com%2Fblogs%2Frun-vba-code-outlook%2F)
* [ ](https://vk.com/share.php?url=https%3A%2F%2Fwww.datanumen.com%2Fblogs%2Frun-vba-code-outlook%2F)
* [ ](https://www.xing.com/spi/shares/new?url=https%3A%2F%2Fwww.datanumen.com%2Fblogs%2Frun-vba-code-outlook%2F)

_At times you may wish to utilize VBA code in Outlook to achieve more functions. Yet, you do not know how to run VBA code in your Outlook. Thus, this article will expose the detailed steps to you._

Thereinafter, we will take Outlook 2010 version as an example and show you the elaborate steps, ranging from modifying macro security settings to running VBA code. Now, read on to get them.

## Step 1: Enable “Developer” Tab

1. First of all, after launching Outlook, access “File” menu.![Access File Menu](https://www.datanumen.com/blogs/wp-content/uploads/2017/10/access-file-menu.jpg "Access File Menu")
2. Then, in “File” menu, select and click on “Options”.![Select Options in File Menu](https://www.datanumen.com/blogs/wp-content/uploads/2017/10/select-options.jpg "Select Options in File Menu")
3. Next, in the popup “Outlook Options” window, switch to “Customize Ribbon”.
4. Later, on the right side, you can find out and enable the “Developer” tab.![Enable the “Developer” Tab]()
5. Lastly, click “OK”.

## Step 2: Check Macro Security Settings

1. After returning to Outlook main window, you can access “Developer” ribbon.
2. Then, click on the “Macro Security” button.![Open Macro Security]()
3. In the subsequent screen, you should select “Notifications for all macros” and hit “OK” button.![Change Macro Security]()

## Step 3: Access Outlook VBA Editor

To run VBA code, you have to access the VBA editor firstly, which can be achieved by the following 2 means:

1. In Outlook, under the “Developer” tab, click on the “Visual Basic” button.![Access VBA Editor by "Visual Basic" Button]()
2. Or you can directly press “Alt + F11” key buttons.

## Step 4: Add VBA Code

1. In VBA editor, namely “Microsoft Visual Basic for Applications” window, you need to expand the “Microsoft Outlook Objects” folder on left side
2. Then, double click on the “ThisOutlookSession” project to open it.![Open “ThisOutlookSession” Project]()
3. Subsequently, you can copy and paste your VBA code into the white editing pane of this project.![Paste VBA Code]()
4. Optionally, you can copy the VBA code into a module.
* Click “Insert” button in the menu bar.
* Choose “Module” from the drop down list.![Insert New Module]()
* Then, a new module will display. Now you can copy code into the module as usual.![New Module]()

**Note:** In general, you can paste the code into either “ThisOutlookSession” or a module. But, the VBA code involving events, like “Application\_Start”, must be put in “ThisOutlookSession”.

## Step 5: Run VBA Code

After adding the macro, you can run it. In the macro window, you can press “F5” key button or click on the “Run” button in the toolbar.![Run VBA Code]()

**Note:** For the VBA code involving events, like “Application\_Start”, you ought to restart your outlook to activate it.

## Optional Step: Add Macro to Quick Access Toolbar or Ribbon

If you would like to run macro in the main Outlook window instead of in the VBA editor, you can add the macro to Quick Access Toolbar or ribbon.

### Add Macro to Quick Access Toolbar

1. First off, access “Outlook Options” by following the operations shown in Step 1, in which you can shift to “Quick Access Toolbar” tab.
2. Next, select “Macros” from the “Choose commands from”.
3. Then, in the macro list, choose a macro.
4. After that, click “Add >>” button in center.
5. Finally, click “OK”.![Add Macro to Quick Access Toolbar]()
6. Since then, to run this macro, you can simply click the macro button in Quick Access Toolbar.![Run Macro through Quick Access Toolbar]()

### Add Macro to Ribbon

1. At first, go to “File” menu and click “Options”.
2. In the subsequent “Outlook Options” window, turn to “Customize Ribbon”.
3. Then, on the right side, click “New Group” button.![Create New Group in Ribbon]()
4. Next, click “Rename” button.
5. In the popup dialog box, specify a name and icon for the new group, such as “Smart Move” in my instance, and click “OK”.![Rename New Group]()
6. Later, on the left side, select “Macros” from the drop-down list of “Choose Commands from”.
7. After that, in the macro list, select the macro you want.
8. Then, click “Add >>” button in center to add this macro to the custom group.![Add Macro to New Group]()
9. Next, click “Rename” button.
10. In the new dialog box, change the name of this macro and assign an icon to it.![Rename the Macro Button]()
11. Ultimately, click a series of “OK” until getting back to Outlook main window.
12. Now, you will see the new macro button in ribbon, as shown in the following screenshot.![New Macro Button in Ribbon]()

## Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including [mdf recovery](https://www.datanumen.com/sql-recovery/) and outlook repair software products. For more information visit [www.datanumen.com](https://www.datanumen.com/)

Share Now: 
* [ ](https://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.datanumen.com%2Fblogs%2Frun-vba-code-outlook%2F)
* [ ](https://x.com/share?url=https%3A%2F%2Fwww.datanumen.com%2Fblogs%2Frun-vba-code-outlook%2F&text=How+to+Run+VBA+Code+in+Your+Outlook)
* [ ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fwww.datanumen.com%2Fblogs%2Frun-vba-code-outlook%2F)
* [ ](javascript:void%28%28function%28%29%7Bvar%20e=document.createElement%28'script'%29;e.setAttribute%28'type','text/javascript'%29;e.setAttribute%28'charset','UTF-8'%29;e.setAttribute%28'src','//assets.pinterest.com/js/pinmarklet.js?r='+Math.random%28%29%2A99999999%29;document.body.appendChild%28e%29%7D%29%28%29%29;)
* [ ](https://www.reddit.com/submit?url=https%3A%2F%2Fwww.datanumen.com%2Fblogs%2Frun-vba-code-outlook%2F&title=How+to+Run+VBA+Code+in+Your+Outlook)
* [ ](https://www.tumblr.com/share/link?url=https%3A%2F%2Fwww.datanumen.com%2Fblogs%2Frun-vba-code-outlook%2F)
* [ ](https://vk.com/share.php?url=https%3A%2F%2Fwww.datanumen.com%2Fblogs%2Frun-vba-code-outlook%2F)
* [ ](https://www.xing.com/spi/shares/new?url=https%3A%2F%2Fwww.datanumen.com%2Fblogs%2Frun-vba-code-outlook%2F)

[← Previous post](https://www.datanumen.com/blogs/5-solutions-invalid-b-tree-node-size-error-mac-system/)

[Next post →](https://www.datanumen.com/blogs/add-object-library-reference-vba/)

Comments are closed.

![Data Recovery Blog]() 

Follow or like us on Facebook, LinkedIn and Twitter to get all promotions, latest news and updates on our products and company.

* [ ](https://www.facebook.com/DataNumen)
* [ ](http://www.linkedin.com/company/datanumen)
* [ ](https://twitter.com/DataNumen)

### Featured Products

* [DataNumen Outlook Repair](https://www.datanumen.com/outlook-repair/)
* [DataNumen SQL Recovery](https://www.datanumen.com/sql-recovery/)
* [DataNumen Exchange Recovery](https://www.datanumen.com/exchange-recovery/)
* [DataNumen Access Repair](https://www.datanumen.com/access-repair/)
* [DataNumen Excel Repair](https://www.datanumen.com/excel-repair/)
* [DataNumen PDF Repair](https://www.datanumen.com/pdf-repair/)
* [DataNumen Word Repair](https://www.datanumen.com/word-repair/)
* [DataNumen Zip Repair](https://www.datanumen.com/zip-repair/)

### Popular posts

[ ](#masthead)

```json
{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.datanumen.com\/blogs\/run-vba-code-outlook\/#article","isPartOf":{"@id":"https:\/\/www.datanumen.com\/blogs\/run-vba-code-outlook\/"},"author":{"name":"AuthorCCW","@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/person\/33ded6c47c77587f9158d99f05e23957"},"headline":"How to Run VBA Code in Your Outlook","datePublished":"2017-10-10T03:02:28+00:00","dateModified":"2025-09-29T10:37:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.datanumen.com\/blogs\/run-vba-code-outlook\/"},"wordCount":682,"commentCount":15,"publisher":{"@id":"https:\/\/www.datanumen.com\/blogs\/#organization"},"image":{"@id":"https:\/\/www.datanumen.com\/blogs\/run-vba-code-outlook\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2017\/10\/access-file-menu.jpg","articleSection":["Outlook Solutions"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.datanumen.com\/blogs\/run-vba-code-outlook\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.datanumen.com\/blogs\/run-vba-code-outlook\/","url":"https:\/\/www.datanumen.com\/blogs\/run-vba-code-outlook\/","name":"How to Run VBA Code in Your Outlook","isPartOf":{"@id":"https:\/\/www.datanumen.com\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.datanumen.com\/blogs\/run-vba-code-outlook\/#primaryimage"},"image":{"@id":"https:\/\/www.datanumen.com\/blogs\/run-vba-code-outlook\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2017\/10\/access-file-menu.jpg","datePublished":"2017-10-10T03:02:28+00:00","dateModified":"2025-09-29T10:37:54+00:00","description":"At times you may wish to utilize VBA code in Outlook to achieve more functions. Yet, you do not know how to run VBA code in your Outlook. Thus, this article will expose the detailed steps to you.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.datanumen.com\/blogs\/run-vba-code-outlook\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanumen.com\/blogs\/run-vba-code-outlook\/#primaryimage","url":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2017\/10\/access-file-menu.jpg","contentUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2017\/10\/access-file-menu.jpg","width":664,"height":198,"caption":"Access File Menu"},{"@type":"WebSite","@id":"https:\/\/www.datanumen.com\/blogs\/#website","url":"https:\/\/www.datanumen.com\/blogs\/","name":"Data Recovery Blog","description":"Discuss every aspect of data recovery","publisher":{"@id":"https:\/\/www.datanumen.com\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.datanumen.com\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.datanumen.com\/blogs\/#organization","name":"Data Recovery Blog","url":"https:\/\/www.datanumen.com\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2019\/02\/logowithouttext.jpg","contentUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2019\/02\/logowithouttext.jpg","width":296,"height":397,"caption":"Data Recovery Blog"},"image":{"@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataNumen","https:\/\/x.com\/DataNumen","http:\/\/www.linkedin.com\/company\/datanumen","https:\/\/myspace.com\/datanumen\/","http:\/\/www.pinterest.com\/datanumen\/","https:\/\/www.youtube.com\/channel\/UCVIIuuKfUBHSJauUaVP13tw"]},{"@type":"Person","@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/person\/33ded6c47c77587f9158d99f05e23957","name":"AuthorCCW","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3516ed90fc242780d3947a989f895bc46e70c3e83485d30f2b457a007906aa58?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3516ed90fc242780d3947a989f895bc46e70c3e83485d30f2b457a007906aa58?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3516ed90fc242780d3947a989f895bc46e70c3e83485d30f2b457a007906aa58?s=96&d=mm&r=g","caption":"AuthorCCW"},"sameAs":["https:\/\/www.datanumen.com\/"]}]}
```
