VBA Code Samples

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

Autoaccept a Meeting Request using Rules

Autoaccept a Meeting Request using Rules

Use Outlook's Rules Wizard and a Run a Script rule to autoaccept (or decline) meeting requests in Microsoft Outlook. Includes a version that checks your Free/Busy status before accepting (or declining).

Published or updated on Jan 29, 2015
Save Messages as *.DOC File Type

Save Messages as *.DOC File Type

If you want to save messages in a universal format and want the attachments stay with the document, you need to convert the message to RTF format then save the message in *.doc format. . While you can do this in Outlook, it takes several steps. Using VBA to save messages to your hard drive in *.doc format takes just seconds.

Published or updated on Jan 28, 2015
Working with All Items in a Folder or Selected Items

Working with All Items in a Folder or Selected Items

These samples contains the basic code for working with all items in a selected folder or selected items in a folder.

Published or updated on Jan 26, 2015
Categorize Messages using Contact Category

Categorize Messages using Contact Category

Use a macro to apply categories assigned to a contact to the messages they send you.

Published or updated on Jan 25, 2015
Apply Outlook Stationery to Replies and Forwards

Apply Outlook Stationery to Replies and Forwards

Although Outlook doesn't include a way to use stationery with replies and forwards, you can use a macro to insert stationery into a reply or forward. You can also use the macro to insert a boilerplate text file.

Published or updated on Jan 25, 2015
Create a New Message using an HTML File or Stationery

Create a New Message using an HTML File or Stationery

How to create a new message using Stationery or any HTML file using the standard commands of More Stationery or Insert > Insert as Text command. You can also use a macro to create the message.

Published or updated on Jan 25, 2015
How to Hide or Delete Outlook's Default Folders

How to Hide or Delete Outlook's Default Folders

Step-by-step instructions you can use to delete or hide the default folders (such as the junk email and suggested contacts folders) that Microsoft Outlook creates in your data files.

Published or updated on Jan 25, 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 Jan 16, 2015
Send email from another address using VBA

Send email from another address using VBA

Use VBA to send an email using a Exchange server distribution list address you have Send as permissions for.

Published or updated on Jan 10, 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 Jan 9, 2015
Create appointments using spreadsheet data

Create appointments using spreadsheet data

Use an Excel macro to create appointments in subcalendars in Outlook. To use, type the appointment data, including the calendar name, into the spreadsheet then run the macro. The macro creates appointments in the correct calendar folder.

Published or updated on Jan 9, 2015
Create a custom Send to... shortcut

Create a custom Send to... shortcut

How to create your own send to shortcut that uses your Outlook stationery and signature. Customize the shortcuts to include the email addresses and more.

Published or updated on Jan 6, 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 Jan 6, 2015
Find the Distribution Lists a Contact Belongs to

Find the Distribution Lists a Contact Belongs to

How to use VBA to create a list of the distribution lists (contact groups) your Outlook Contacts belong to.

Published or updated on Jan 6, 2015
Receive a Reminder When a Message Doesn't Arrive?

Receive a Reminder When a Message Doesn't Arrive?

Use a run a script rule to set reminders to alert you if a new message (such as routine server alerts) doesn't arrive within a specified time.

Published or updated on Jan 5, 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 Jan 5, 2015
Combine and Print Multiple Outlook Calendars

Combine and Print Multiple Outlook Calendars

How to copy appointments from several Outlook calendars to print as one calendar.

Published or updated on Dec 31, 2014
Enable or disable an Outlook rule using reminders and VBA

Enable or disable an Outlook rule using reminders and VBA

Do you want Outlook to run certain rules during specific time periods, like only overnight, then turn them off when you are in the office? You can use VBA and task reminders to turn your rules off and on.

Published or updated on Dec 30, 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 Dec 26, 2014
How to Create Messages Using Data in an Excel File

How to Create Messages Using Data in an Excel File

Create Outlook email messages using data contained in an Excel workbook OR CSV file.

Published or updated on Dec 26, 2014
This site uses XenWord.