VBA Code Samples

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

Save selected email message as .msg file

Save selected email message as .msg file

A VBA code sample to save one or more selected messages to your My Documents folder as .msg files, using the received date and time as the filename.

Published or updated on Dec 17, 2014
Macro to file Outlook email by sender's display name

Macro to file Outlook email by sender's display name

Use a macro to file Outlook Email in folders by sender's name. Or file your email by received date.

Published or updated on Dec 17, 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 Dec 14, 2014
Use Instant search to find messages from a contact

Use Instant search to find messages from a contact

Use VBA to create an Instant Search query for a selected contact or for messages sent to and from an email address. Can use this macro to search for journal items in Outlook 2013.

Published or updated on Dec 12, 2014
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 Dec 12, 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 11, 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 Dec 8, 2014
Print Outlook Business Card Images

Print Outlook Business Card Images

Use this macro to create and print a Microsoft Word document containing Outlook's business cards. The macro saves the card as a jpg image then inserts it into a Word document. How to use macros First: You will need macro security set to low during testing. To check your macro security in Outlook 2010 or  

Published or updated on Dec 8, 2014
Print Contacts and Contact Photos

Print Contacts and Contact Photos

Use VBA to create a Word document containing the selected contact's name, address, phone number and contact photo.

Published or updated on Dec 8, 2014
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 Dec 8, 2014
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 Dec 7, 2014
Create a Series of Tasks Leading up to an Appointment

Create a Series of Tasks Leading up to an Appointment

The code sample on this page creates tasks from a selected appointment, with each task due in the days leading up to the appointment.

Published or updated on Dec 7, 2014
Create a Series of Tasks using VBA

Create a Series of Tasks using VBA

Using VBA, you can automatically create a series of Outlook tasks based on a task or appointment. You can create the tasks leading up to an appointment or task or following an appointment or task.

Published or updated on Dec 7, 2014
Always use Tasks, not Outlook's To-Do List

Always use Tasks, not Outlook's To-Do List

How to use VBA to always select the desired Task folder when you open the Tasks navigation pane.

Published or updated on Dec 6, 2014
Using Voting Buttons in Email

Using Voting Buttons in Email

I had a few questions about Outlook's voting buttons this week. Several users wondered why the voting buttons weren't working on messages sent to addresses outside of the company. When you add voting buttons to an email, the message is sent using Rich Text Format (RTF). Because only Outlook can decode RTF messages, many Exchange  

Published or updated on Dec 5, 2014
Use a macro to move IMAP account sent items

Use a macro to move IMAP account sent items

Use a VBA macro in Outlook to move IMAP sent items to the Sent items folder on the IMAP server.

Published or updated on Dec 4, 2014
Make the Address Book show only e-mail addresses, not fax numbers

Make the Address Book show only e-mail addresses, not fax numbers

Outlook includes fax numbers in the address book because they are valid electronic addresses. You can hide fax numbers from the address book by using a macro or an addin.

Published or updated on Dec 1, 2014
Map Contact Addresses or Meeting Locations

Map Contact Addresses or Meeting Locations

How to create a map or driving directions to one or more Outlook Contact's address or Meeting locations using VBA.

Published or updated on Nov 30, 2014
Delegates, Meeting Requests, and Rules

Delegates, Meeting Requests, and Rules

How to use a run a script rule in Outlook to add a category to delegated meetings.

Published or updated on Nov 27, 2014
Outlook Categories, Flags, and IMAP Accounts

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  

Published or updated on Nov 24, 2014