• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Outlook Tips

Learning Microsoft Outlook One Tip At A Time

Diane Poremsky [Outlook MVP]

  • Home
  • Tips Archive
  • How to...
  • Beginner
  • Outlook.com

How to use VBA code samples in Outlook

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.

Published May 14, 2011. Last updated on June 7, 2021.

Share this:

  • Twitter
  • Facebook
  • LinkedIn
  • More
  • Print
  • Tumblr
  • Reddit
  • Pocket
  • Pinterest

Related posts:

attachment iconChanging Outlook's Reply Format If you use Microsoft's OneCare you are prevented from using the No Security check macro setting. If you choose this option (whTip 597: OneCare and Macro Security Every now and again we get a question that goes like this: “I'm not sure what button combo I hit, but I can no longer type WebTip 652: Hyperlink Code The view on Outlook 2007's To-do bar can be customized using any of the customization options available for Task views, includTip 469: Color Code To-do Bar's Task list
Subscribe
Notify of
1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Primary Sidebar

Search OutlookTips

Training and one-on-one assistance

Do you need help setting up Outlook or want some one-on-one training? I'm available for hire. See Training and one-on-one assistance for fees and to check availability.

All-Time Most Popular Posts

  • Windows 7 and Vista Start Search field
    How to start Outlook in safe mode
  • outlook.com icon
    Delete a message stuck in Outlook's Outbox
  • How to use Outlook's Command line switches
  • Use Cleanviews switch to reset all views
    How to Reset the View on Outlook folders
  • Where are my Outlook Files?
  • Folder paths
    How to Find Folder Paths in Outlook Mailboxes
  • How to use Scanpst.exe to repair Outlook data files
  • Outlook's Missing Holidays
  • backstage page
    Where is File tab in Outlook?
  • Icons found in the Inbox, Message Headers, and Toolbars

Footer

Recent Posts

  • Log into multiple Outlook on the web accounts
  • Keeping Hackers out of Microsoft accounts
  • Microsoft Account Closure Email
  • Outlook on the web Quick Actions moved to the right
  • Automatically sign out of Outlook.com

Recent Bug List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in Outlook for Windows.

Office Update History

Update history for supported Office versions is at Update history for Office

Resources

Ask questions and share your knowledge in Outlook Forums.

You Might Like

Where is File tab in Outlook?
Using Two-factor authentication
Where are my Outlook Files?
How to use Outlook's Command line switches

© 2003–2025 · Outlook Tips

wpDiscuz
You are going to send email to

Move Comment