VBA Code Samples

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

Use a Rule to delete older messages as new ones arrive

Use a Rule to delete older messages as new ones arrive

Use a run a script rule to delete older versions of an email message from Outlook. Great for status reports and similar messages.

Published or updated on Apr 17, 2014
Macro to Export Outlook Fields to Excel

Macro to Export Outlook Fields to Excel

Use a macro to write Outlook values to an Excel spreadsheet.

Published or updated on Apr 17, 2014
Backup Calendar, Contacts, Tasks in an IMAP data file

Backup Calendar, Contacts, Tasks in an IMAP data file

Use a macro to copy appointments, contacts, tasks, and notes to a *.pst file before removing an IMAP account from Outlook 2013.

Published or updated on Apr 11, 2014
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 Apr 4, 2014
Save Outlook email as a PDF

Save Outlook email as a PDF

How to use VBA to save selected Outlook messages as PDF files.

Published or updated on Apr 3, 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 Apr 1, 2014
Convert RTF Messages to Plain Text Format

Convert RTF Messages to Plain Text Format

Use a simple macro to convert RTF formatted messages to plain text format.

Published or updated on Mar 28, 2014
Edit and Save Outlook's Read-Only Attachments

Edit and Save Outlook's Read-Only Attachments

Solutions available! When attachments are opened from a message in Outlook 2010, they are read-only. Users cannot edit the attachment and save the changes back to the message, they need to save the attachment to the hard drive and reattach it.

Published or updated on Mar 27, 2014
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 27, 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 Mar 27, 2014
Script to remove all PST files from a profile

Script to remove all PST files from a profile

Use a simple VBScript to remove PST files from the default profile when Outlook is closed. Use the script when Outlook is open to remove the PST files from the current profile.

Published or updated on Mar 14, 2014
Run a Script Rule: Send a new message when a message arrives

Run a Script Rule: Send a new message when a message arrives

How to use a Run a Script rule to have Microsoft Outlook automatically send a new email message using a template to new email addresses when a message meeting specific conditions arrives.

Published or updated on Mar 14, 2014
Macro to Create an Outlook Contact from an Email Message

Macro to Create an Outlook Contact from an Email Message

Use a macro to create Outlook Contacts for people who sent an email message. Save the contact to the default Contacts folder or to a different Contacts folder.

Published or updated on Mar 7, 2014
Find messages in a conversation

Find messages in a conversation

When you use Instant Search to find messages from a person, the results contain only messages from that person, not all messages in the conversation. You can use a macro to create an Instant Search that includes messages to and from the sender of the selected message.

Published or updated on Mar 5, 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 Feb 21, 2014
Outlook AutoReplies: One script, many responses

Outlook AutoReplies: One script, many responses

How to use one Run a Script rule in Outlook to respond with different Autoreply messages.

Published or updated on Feb 21, 2014
Display the Recipient Email Address in the Sent Items folder

Display the Recipient Email Address in the Sent Items folder

Use a macro to create a field in Outlook's Sent Items folder that displays the email addresses the message was sent to.

Published or updated on Feb 20, 2014
Copy: is prefixed to the Subject of a Meeting

Copy: is prefixed to the Subject of a Meeting

Beginning with Outlook 2007 SP2, "Copy:" is added to the subject line of a meeting that is copied from a shared calendar. Workarounds are available.

Published or updated on Feb 19, 2014
Macro to Move Aged Email Messages

Macro to Move Aged Email Messages

How to use a macro to move email, meeting requests, and more to another folder as they age or using other conditions. Create folders for the sender's display name to move the messages to.

Published or updated on Feb 16, 2014
Warn before sending messages to the wrong email address

Warn before sending messages to the wrong email address

Do you accidently send messages to the wrong email address? You can use a VBA macro that checks the outgoing addresses before sending the message.

Published or updated on Feb 13, 2014