• Outlook User
  • Exchange Admin
  • Office 365
  • Outlook Developer
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
    • Common Problems
    • Outlook BCM
    • Utilities & Addins

VBA Code Samples

Slipstick Systems

The articles listed below contain VBA code samples. Additional code samples are listed at Developer Samples

VBA Code Samples was last modified: February 8th, 2018 by Slipstick
Contact forms properties

How to Set a Custom Form as the Default for a Folder

You can easily change the default form used for new items for any folder type except Mail folders. Although the screenshots are for contacts, the steps are the same for Calendar & Tasks. Right click on the folder name and choose Properties. Then select the new form from the General tab, When posting to this  

Template warning

How to Open Outlook Templates and Files using Toolbar Buttons

How to create a toolbar button in Outlook 2007 or Outlook 2010 to open templates and files and disable the security warning dialog that displays before the template or files opens.

Combine and Print Multiple Outlook Calendars

How to copy appointments from several Outlook calendars to print as one calendar. Includes code specific to Exchange server accounts that works with Resource calendars as well as other user's calendars.

Remove [External] from Message Subject

A user wanted to know how to remove [External] from the subject of incoming messages. My company recently instituted the policy that puts the [EXTERNAL] tag in every subject when an email is received from outside the organization. When it's only one email, it's not really an issue. However, when it turns into a thread  

Automatically change Appointment categories using VBA

How to assign a category to appointments automatically, as soon as they are over, using a macro with a trigger, such as the meetings own reminder or the next appointment reminder, that will kick off the macro.

Outlook Categories, Flags, and IMAP Accounts

Categories and flags are not available in all of my folders in Microsoft Outlook. I can use categories and flags on mail in my POP3 account but categories are not available in my IMAP account and flags are limited to one flag, no reminder. Why? The IMAP protocol doesn't support the Category and Flag properties  

add suffix to attachment name

Rename Outlook Attachments

This macro allows you to rename attachments on incoming or outgoing messages.

VBA icon

Parsing text fields in Outlook

How to use Len, Left, Right, Mid, and InStr to extract text from Microsoft Outlook fields and message bodies.

click on the percentage to open the dialog

Adjusting Outlook's Zoom Setting in Email

New to Outlook 365: Remember Zoom Preferences. If the fonts in incoming messages are tiny (or huge), you may have a Zoom problems. I'll show you how to fix it. If you don't have an Office 365 subscription, I have a macro that will set the zoom level for you.

Get Outlook's Internet Headers using VBA

Use this code sample and function to display the Internet header of selected message in a new message form.

Enable Contacts as Address Book using VBA

A user with way too many contact folders created a new profile and none of the contact folders were listed in the Address Book menu. With more than 200 contacts folders, it would take several hours to enable each folder manually. I had a macro that needed just a little tweaking to set the folders  

Assign a custom form to existing Outlook items

Use this VBA macro as an alternative to DocMessageClass for changing an Outlook item's message class.

How to use Windows File Paths in a Macro

How to choose the file path when you save an Outlook attachment or a message using a VBA macro.

original and resized images

Resize images in an Outlook email

Use a VBA macro to resize large images in received email.

add border to images in an outlook email

Format Images in Outlook Email

This variation of the Resize Images in Email macro puts a border and shadow around all images in the message you are composing.

« Previous Page
Next Page »

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 28 Issue 7

Support Services

Do you need help setting up Outlook, moving your email to a new computer, migrating or configuring Office 365, or just need some one-on-one assistance?

Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • WeekMonthAll
  • Outlook's Left Navigation Bar
  • Adjusting Outlook's Zoom Setting in Email
  • How to Remove the Primary Account from Outlook
  • Save Sent Items in Shared Mailbox Sent Items folder
  • Use PowerShell to get a list of Distribution Group members
  • Create rules that apply to an entire domain
  • Move an Outlook Personal Folders .pst File
  • Remove a password from an Outlook *.pst File
  • Meeting Requests and Appointments are Off by One Hour
  • View Shared Calendar Category Colors
  • Change Appointment Reminder Sounds
  • Messages appear duplicated in message list
  • Reset the New Outlook Profile
  • Delete Old Calendar Events using VBA
  • Use PowerShell or VBA to get Outlook folder creation date
  • Outlook's Left Navigation Bar
  • Contact's Display Bug
  • Use PowerShell to get a list of Distribution Group members
  • Edit Outlook’s Attach File list
  • Outlook Error: Google Couldn't sign you in
Ajax spinner

Newest Code Samples

Delete Old Calendar Events using VBA

Use PowerShell or VBA to get Outlook folder creation date

Rename Outlook Attachments

Format Images in Outlook Email

Set Outlook Online or Offline using VBScript or PowerShell

List snoozed reminders and snooze-times

Search your Contacts using PowerShell

Filter mail when you are not the only recipient

Add Contact Information to a Task

Process Mail that was Auto Forwarded by a Rule

Recent Bugs List

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

Outlook for Mac Recent issues: Fixes or workarounds for recent issues in Outlook for Mac

Office Update History

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

Outlook Suggestions and Feedback

Outlook Feedback covers Outlook as an email client, including Outlook Android, iOS, Mac, and Windows clients, as well as the browser extension (PWA) and Outlook on the web.

Use Outlook.com Feedback for suggestions or feedback about Outlook.com accounts.

Other Microsoft 365 applications and services




Windows 10 Issues

  • iCloud, Outlook 2016, and Windows 10
  • Outlook Links Won’t Open In Windows 10
  • Outlook can’t send mail in Windows 10: error Ox800CCC13
  • Missing Outlook data files after upgrading Windows?

Outlook Top Issues

  • The Windows Store Outlook App
  • The Signature or Stationery and Fonts button doesn’t work
  • Outlook’s New Account Setup Wizard
  • Outlook 2016: No BCM
  • Exchange Account Set-up Missing in Outlook 2016

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes

Contact Tools

Data Entry and Updating

Duplicate Checkers

Phone Number Updates

Contact Management Tools

Diane Poremsky [Outlook MVP]

Make a donation

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Outlook Suggestion Box (UserVoice)

Slipstick Support Services

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Advertise | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2023 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.