VBA Code Samples

This is a list of the 252 articles published on slipstick.com that contain VBA code samples. The newest code samples and most recently updated pages are listed first.

Send a Task Status Report

Send a Task Status Report

Send an Outlook Task update using the Task Update button or customize the update using a macro.

Published or updated on Mar 18, 2015
Outlook, Multiple Accounts and the Default Account

Outlook, Multiple Accounts and the Default Account

When you use Microsoft Outlook 2010 or Outlook 2013 and have multiple accounts delivered to different *.pst files, Outlook doesn’t use the default account set in Account settings. Instead, it uses the account associated with the mailbox or *.pst file the folder you are viewing is stored in. This change in behavior doesn't work well when an IMAP is configured to be the default email account and you have a POP3 account delivered to the default pst file.

Published or updated on Mar 17, 2015
Scheduling Drafts in Outlook

Scheduling Drafts in Outlook

How to send draft messages at a scheduled time using a macro in Outlook.

Published or updated on Mar 15, 2015
Print a list of your Outlook folders

Print a list of your Outlook folders

How to create a list of the folders in Microsoft Outlook data files. This code works with any data file in the Outlook profile.

Published or updated on Mar 15, 2015
Categorize Yammer Messages by Group

Categorize Yammer Messages by Group

How to use a macro to categorize incoming Yammer messages using an ItemAdd macro.

Published or updated on Mar 12, 2015
Send an email when you add an appointment to your calendar

Send an email when you add an appointment to your calendar

How to use VBA to send an email to someone when a new appointment is added to your Outlook calendar.

Published or updated on Mar 12, 2015
Use VBA to create an Outlook Search Folder for Sender

Use VBA to create an Outlook Search Folder for Sender

How to use VBA to create a search folder for messages sent to and from the sender of the selected message. VBA code sample included.

Published or updated on Mar 11, 2015
Read MAPI properties not exposed in Outlook's Object Model

Read MAPI properties not exposed in Outlook's Object Model

How to read MAPI properties that are not exposed in the VBA Object model using the Property Accessor object.

Published or updated on Mar 9, 2015
Get Outlook's Internet Headers using VBA

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.

Published or updated on Mar 9, 2015
Save and Rename Outlook Email Attachments

Save and Rename Outlook Email Attachments

Use a macro to save attachments on Outlook email messages to a folder on your hard drive and add the files last modified date to the filename.

Published or updated on Mar 9, 2015
Use RegEx to extract text from an Outlook email message

Use RegEx to extract text from an Outlook email message

Getting text out of a message body isn't as hard as it sounds, provided there is something in the body to search on. For example, if you are looking for a tracking code in an email and it's always identified as "Tracking code:" , you can use VB functions or RegEx to get the string.

Published or updated on Mar 8, 2015
Working with VBA and non-default Outlook Folders

Working with VBA and non-default Outlook Folders

How to use VBA to 'do something' in Outlook's non-default folders.

Published or updated on Mar 8, 2015

Remove reminders from appointments that occur in the past

Two macros to remove reminder from appointments. The first macro removes the reminders as the appointment is created in a specific calendar folder. The other macro removes reminders from older items.

Published or updated on Feb 26, 2015
Use an Outlook Macro to Send Files by Email

Use an Outlook Macro to Send Files by Email

How to send all of the files in a folder as email attachments, one attachment per Outlook message using a VBA macro.

Published or updated on Feb 24, 2015
How to use Outlook's VBA Editor

How to use Outlook's VBA Editor

Basic instructions on using Outlook's VBA editor: how to open it, where to put the code, how to sign your code.

Published or updated on Feb 22, 2015
Add Secure to the Message Subject before Sending

Add Secure to the Message Subject before Sending

Several users asked me how to add secure to the message subject before sending the message. I need a way to change the subject of an email after I hit send. Specific example: If I have a subject that says "meeting", after I hit send I would like the subject to be automatically changed to  

Published or updated on Feb 20, 2015
Sort messages by Sender domain

Sort messages by Sender domain

How to sort email messages by domain. Although you can filter by domain simply by typing the domain name in the address field of the filter dialog, you need to use a macro to sort by domain.

Published or updated on Feb 20, 2015
Log Messages and Attachment Names

Log Messages and Attachment Names

Kamram was looking for a way to create a log file of messages and their attachments. While you can simply select all messages in a folder and copy to Excel, this won't include the attachment names. Fortunately, picking up the attachment names and creating a new message or sending the data to Excel is not  

Published or updated on Feb 19, 2015
Filter and Save Contacts to a CSV File

Filter and Save Contacts to a CSV File

How to use a macro to filter and export Outlook Contacts to a CSV file.

Published or updated on Feb 19, 2015
Fix the Outlook Folder Type after Exporting an IMAP Account

Fix the Outlook Folder Type after Exporting an IMAP Account

After importing IMAP folders to Personal Folders or an Exchange mailbox, messages in the imported folder are hidden.

Published or updated on Feb 19, 2015
This site uses XenWord.