How to use VBA code samples in Outlook

May 14, 2011
By

So you found some code on the Internet that you think might do what you need done. But how do you use it?

First you need to open the VBA Editor by pressing Alt+F11.

Expand Microsoft Outlook Objects

Double click on ThisOutlookSession to open it in the editing pane on the right side.

VBA Editor

Paste (or type) the code sample into ThisOutlookSession.

Press F5 or the Run button to run the macro. (It’s highly recommended you make a backup of the folders or message store before running macros.)

You’ll also need to change macros security or use selfcert.exe to sign your macros. Access the dialog to change the security level from Tools, Macros, Security. Set it on “always ask”. Do not choose the Low option (run all, never ask). Some security software will set it to High and your macros will not run.

Need help with sample code? Try the forums at Outlookcode.com or the Microsoft programming forms, accessible though OutlookForums

Both Outlookcode and VBOffice.net have a large number of code samples.

Related posts:

Tags: ,

« « Go News command is missing in Microsoft Outlook
Using Outlook 2000 on Windows 7 (or Vista) » »

One Response to How to use VBA code samples in Outlook

  1. Salvador on March 28, 2012 at 1:59 pm

    Hello,
    I have Office 2010 and Windows 7. My Macro Settings inside Trust Center Settings are gray out. How do I change these settings ?

Leave a Reply

Your email address will not be published. Required fields are marked *

*


Outlook Daily Tips by Email

*  Your Email Address:

Resources

Ask questions and share your knowledge in Outlook Forums.

More Outlook and Exchange articles available at Outlook and Exchange Solutions Center

Follow me on:

Follow @Outlooktips on Twitter   Join Outlooktips on Facebook



Subscribe to our Exchange Messaging Outlook weekly newsletter

*  Email Address: