VBA Code Samples

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

How to Remove or Change the Reminder on All Day Events

How to Remove or Change the Reminder on All Day Events

While you can't change Outlook's 18 hour default reminder, you can use VBA to remove the reminder or change it to a different time. While the tweaks here work specifically with reminders on All Day events, this code can be tweaked to do almost anything when a new appointment or event is saved.

Published or updated on Oct 31, 2014
Use a Macro to Assign Messages in a Shared Mailbox

Use a Macro to Assign Messages in a Shared Mailbox

How to use an Outlook macro to move messages to a new folder or mailbox or to assign categories to the message round-robin style.

Published or updated on Oct 31, 2014
Using a Gmail Master Account: Reply using the Correct Account

Using a Gmail Master Account: Reply using the Correct Account

How to configure Outlook so you can send email from other email addresses connected to a Gmail account.

Published or updated on Oct 30, 2014
Shortcuts to open Outlook folders

Shortcuts to open Outlook folders

Outlook doesn't support creating shortcuts to folder on the Quick Access toolbar (QAT) or ribbon, but you can put macro on the QAT or ribbon that opens a folder.

Published or updated on Oct 30, 2014
Create an Appointment at the Contact's Address

Create an Appointment at the Contact's Address

How to create a new Outlook meeting with a selected contact. Includes a macro to include the contact's address in the Location field.

Published or updated on Oct 30, 2014
How to Open  Outlook Templates and Files using Toolbar Buttons

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.

Published or updated on Oct 29, 2014
Reply using the address a message was sent to

Reply using the address a message was sent to

Use this code to send a new message using the address the selected message was sent to as the From account. This code is for people who use an account such as Gmail or Hotmail to collect mail from other accounts. Outlook will always reply using the account that downloaded the message, this code selects the send using account based on the address the message was sent to.

Published or updated on Oct 27, 2014
Run a Script Rule: Change Subject then Forward Message

Run a Script Rule: Change Subject then Forward Message

An Outlook user asked how to automatically change the subject of a message and forward it to another address. Using a "run a script" rule is one option and we show you how to do it.

Published or updated on Oct 27, 2014
VBA Sample: Do something when Reply is clicked

VBA Sample: Do something when Reply is clicked

How to "do something" when you click the Reply, Reply All, or Forward button. Add a category, change the subject, add a recipient, add boilerplate text.

Published or updated on Oct 24, 2014
Send an email to attendees who have not responded

Send an email to attendees who have not responded

A common question is how to send a message only to meeting invitees who have no yet responded to the meeting request. While Outlook doesn't include this feature, you can easily do this using VBA.

Published or updated on Oct 23, 2014
Using Windows environment variables in Outlook macros

Using Windows environment variables in Outlook macros

How to use a Windows operating-system Environ property environment variable in a macro to set or get file paths, such as to save attachments or email to the user's My Documents folder. (Works with Word and Excel macros too.)

Published or updated on Oct 23, 2014
Adding Birthdays and Anniversaries to Outlook's Calendar

Adding Birthdays and Anniversaries to Outlook's Calendar

Help managing Contact birthdays that are automatically added by Outlook to your calendar. Included are macros to added birthdays for imported contacts and to change the reminder time.

Published or updated on Oct 23, 2014
Apply a View to a Folder using a Macro

Apply a View to a Folder using a Macro

How to use an Outlook macro to apply a frequently used view to a folder instead of using the Change View command.

Published or updated on Oct 20, 2014
Rename Exchange Mailbox and Account in Outlook 2013

Rename Exchange Mailbox and Account in Outlook 2013

How to rename Exchange account display names that are shown in the navigation pane and From field in Outlook 2013.

Published or updated on Oct 14, 2014
Create Outlook Folders from a List of Folder Names

Create Outlook Folders from a List of Folder Names

How to use a macro to create Outlook folders from a list of folder names in a csv file.

Published or updated on Oct 8, 2014
How to Change the Mapping Service used by Outlook's Map Link

How to Change the Mapping Service used by Outlook's Map Link

How to change the Map service that Outlook uses for the MapIt feature in Outlook Contacts to use your favorite map website.

Published or updated on Oct 2, 2014
Remove an Address from Reply All

Remove an Address from Reply All

Use a macro to remove your own addresses when using Reply All in Microsoft Outlook.

Published or updated on Oct 2, 2014
Use a macro to copy data in Outlook email to Excel workbook

Use a macro to copy data in Outlook email to Excel workbook

Use RegEx to copy text from an email message and insert it into an Excel workbook.

Published or updated on Oct 2, 2014
Set an expiration date on all messages you send

Set an expiration date on all messages you send

How to use VBA to automatically add an expiration date to all messages you send using Microsoft Outlook.

Published or updated on Oct 1, 2014
Macro to Print Outlook email attachments as they arrive

Macro to Print Outlook email attachments as they arrive

An updated macro to print Outlook email attachments as they arrive. This macro works with Outlook 2013 and older, 32 or 64-bit versions, with both 3 and 4 character Office file extensions.

Published or updated on Sep 30, 2014