VBOffice

Free VBA macros for Microsoft® Outlook®. Get more than 100 ready-to-use scripts, or use the samples as a template for your own programming.

OLKeeper OLKeeper
OLKeeper reliably prevents users from closing their Outlook window and thus possibly missing reminders or e-mails.
New: Join Email with Contact Data

This sample demonstrates how to look up the sender of an email and display its contact data in the inbox.

Last modified: 2015/03/30

Order by: ▲ Title  Date
Access an Email With CDO 1.21

Up to Outlook 2003 the CDO 1.21 library offered features you couldn't find in the Outlook object model.

Last modified: 2006/01/20

Access the Email Message Header

This sample creates a user defined property and adds the return path so you can see its value for each email in the folder list view.

Last modified: 2009/07/18

API Timer

A timer enables you to call your code at regular intervals.

Last modified: 2006/01/18

Archive Calendar Items

See how to build your own auto archiving for Outlook folders.

Last modified: 2007/02/07

Assign a Form to an Item

Tell Outlook to use your custom form instead of the default form to display an item.

Last modified: 2009/09/23

Assign Email Categories Before Sending

Check message properties before sending. This sample prompts you if you try to send an email without an assigned category.

Last modified: 2007/04/24

Automatically Categorize a New Appointment

For users of smartphones, for instance, that don't support categories see how to categorize every new appointment.

Last modified: 2009/09/23

Block Travel Times For Your Appointments

This macro makes it easy to add, for instance, travel times for an appointment to the calendar.

Last modified: 2014/01/09

Bulk Edit Contacts

In this sample we change the company name for multiple contacts at once.

Last modified: 2006/01/29

Bulk Edit the Due Date for Multiple Task Items

In this sample we move the due date for several task items at one go.

Last modified: 2013/07/23

Bulk Edit the Priority for Multiple Task Items

In this sample we change the priority for multiple task items at once.

Last modified: 2008/01/15

Categorize Emails Automatically

Let a script categorize every new email.

Last modified: 2007/02/01

Change the Font of a Folder View

Do you want to change the view font of the current folder? This example works for Outlook 2007 and up.

Last modified: 2012/02/22

Check Email Size Before Sending

Get a prompt if the size of an email exceeds a certain limit.

Last modified: 2006/01/18

Color Label for Calendar Items

For Outlook XP and 2003 appointments could be labeled - but not via the Outlook object model. See how to set a color label by code.

Last modified: 2007/05/02

Confirm an Appointment by Email

Right click an appointment in your calendar, and send a confirmation to its linked contacts.

Last modified: 2010/08/24

Confirm Before Moving an Appointment

Never again accidentally drag an apppointment to another day, or time by using this macro.

Last modified: 2014/10/02

Copy Contacts from Access to Outlook

With a few lines of code you can copy recordsets from an Access database to Outlook.

Last modified: 2008/08/23

Copy Folder Views

With VBA you can copy the view settings for one folder to another folder.

Last modified: 2006/05/05

Category-Manager Category-Manager
Access the master category list in the blink of an eye, share your color categories in a network, get a reminder service, and more.
Create a New Journal Item Based on an Existing One

This macro makes it easy to create repeating journal items, for instance, when you often work on the same project.

Last modified: 2007/04/03

Create a Redemption SafeMailItem

The SafeMailItem of the Redemption library allows you to access properties of an email that are blocked by Outlook's security.

Last modified: 2006/05/21

Create a Serial Number

This sample creates a serial number, which you could use, for instance, to index task items.

Last modified: 2006/01/20

Create Automatically New Journal Items for Calls

This sample adds every outgoing call to the journal.

Last modified: 2007/11/22

Create Distributionlist for a Contact Category

Categories are very good for managing your contacts. However, in some cases it might also be good to have the contacts of a given category in a mailing list, which can can used quickly as recipients for an email.

Last modified: 2015/03/12

Creating Nested Distribution Lists

Nested distlists allow to combine groups of contacts to another group.

Last modified: 2008/01/08

Delete Email Follow-up Flag when Completed

The script completely removes the flag once the item is completed.

Last modified: 2007/03/15

Delete Multiple Attachments at Once

Remove the attachments of several selected emails in one go.

Last modified: 2012/08/08

Delete Original Email When Replying

By clicking on Reply you can automatically delete the original email.

Last modified: 2006/09/26

Delete the Read Email And Open the Next One

See how to open the next email and delete the one you've just read.

Last modified: 2007/01/08

Deleting Reminders of Meeting Requests

Are you bothered if every incoming meeting request has a reminder set? This sample deletes the reminder as soon as the request comes in.

Last modified: 2007/08/17

Determine a Folder for Sent Items

Get some samples for how to save a sent message in another folder than the default Sent Items folder.

Last modified: 2007/04/24

Determine the Cursor Position

Since Word's object model is available in Outlook you can set the cursor to a certain position in a message.

Last modified: 2011/03/24

Directly Enter a Category Name

Before Outlook 2007 you could directly add a category to an item without saving it to the master category list. For Outlook 2007 users and up this macro gives you that feature back.

Last modified: 2009/12/15

Display Categorizer for Outgoing Emails

Since Outlook 2007 you can't directly display the categorizer for outgoing e-mails. This sample demonstrates how to display the dialog by code, which works even for IMAP messages.

Last modified: 2008/10/13

Display Options Dialog Before Sending

This sample opens the options dialog before sending an email so you can change some settings, for instance, delay the sending.

Last modified: 2006/01/19

Display the Email Address of the Recipient

Often the display name of an email recipient changes, making it impossible to sort these emails. This macro creates a new field with the pure email address.

Last modified: 2013/10/30

Display the Sender Address in Outlook 2000

This macro enables you to get the sender's address even in older versions of Outlook.

Last modified: 2006/05/05

Edit a Folder View

See how to edit the view settings of a folder.

Last modified: 2009/11/18

Reporter Reporter
VBOffice Reporter is an easy to use tool for data analysis and reporting in Outlook. A single click, for instance, allows you to see the number of hours planned for meetings the next month.
Edit the List of Recipients Before Sending

This macro removes some addresses from an email before it leaves your outbox.

Last modified: 2010/02/20

Embed Pictures in an Email

These vba macros show how to embed a picture in an email so the receiver can see it instead of the dreaded red x.

Last modified: 2006/05/20

Empty a Folder

Delete the content of a folder with a single click.

Last modified: 2007/04/05

Execute Code When a Task is Completed

Often certain actions should take place as soon as one task is done. This sample demonstrates the general approach.

Last modified: 2007/04/13

Expand All Folders

This sample expands your entire folder list.

Last modified: 2007/07/31

Expand the Subfolder When a New Message Arrives

Do you sometimes miss a new email because it's automatically moved to a closed subfolder? This macro expands the subfolder so you can see at a glance whether is has new items.

Last modified: 2013/05/23

Find a Folder by its Name

Don't remember where to find a given folder? With this script you can find the folder by its name.

Last modified: 2015/03/07

Find a Window by the Win32 Api

This demonstrates how to get a window handle by the Win32 API.

Last modified: 2006/02/05

Find Address in CC and Move the Email

This sample finds an address in the list of recipients and then moves the email.

Last modified: 2009/11/23

Flag a Contact For Follow-Up

With VBA is's possible to flag even contacts for follow-up and set a reminder.

Last modified: 2006/01/19

Flag an Email for Follow-up

This demonstrates how to flag emails for follow-up.

Last modified: 2008/10/17

Format Telephone Numbers

A sample for how to consistently format the phone numbers of your contacts.

Last modified: 2013/12/24

Get the Default Email Account

A VBA macro that tells you which of all the available email accounts is the default one.

Last modified: 2006/11/09

Get the Message Folder

Where is the message stored you're looking at? This macro tells you and can even open the folder for you.

Last modified: 2008/06/08

Get the Outlook Version

This macro tells you which Outlook version is running.

Last modified: 2014/01/01

Get the Receiving Account

This macro tells you by which of your accounts a certain message was received.

Last modified: 2006/05/17

Hide Commandbar at Startup

Control by code which of the commandbars should be visible at startup.

Last modified: 2009/08/15

How Many Appointments Do You Have Today?

The sample gets you the number of appointments or meetings of a given day.

Last modified: 2006/01/20

Insert a Formatted Excel Table into an Email

A sample for how to paste a table from Excel and retaining its formattings.

Last modified: 2007/01/29

ReplyAll ReplyAll
ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the e-mail.
Join Email with Contact Data

This sample demonstrates how to look up the sender of an email and display its contact data in the inbox.

Last modified: 2015/03/30

Limit the Size of Loops

There could be a limit of how many items you can access in a single loop. See how to handle that situation.

Last modified: 2006/12/02

Link a Contact Item to Other Items

This sample explains the Links property, which is used to join any item (task item, contact item, etc.) with other items.

Last modified: 2014/02/26

Looping Recursively Through Folders and Subfolders

These samples demonstrate the basics for a recursive loop through folders and their subfolders.

Last modified: 2015/03/28

Make a Form of Your Own Modal Against Other Processes

This macro prevents users from working in another program while your program is waiting for an input.

Last modified: 2006/02/05

Mark Calendar Items Read/Unread

With a VBA macro all types of items like appointments, or contacts can be marked read, or unread.

Last modified: 2014/05/23

Mark Emails Automatically as Read

This sample demonstrates how to mark an e-mail as read as soon is it's being copied or moved to a folder.

Last modified: 2008/09/15

Mark Multiple Messages as Spam at Once

This macro allows to add several messages at once to the blocked senders list.

Last modified: 2013/12/06

Merge Email Conversations

This sample shows how to merge any emails to the same conversation.

Last modified: 2014/10/09

Move Completed Emails

This sample demonstrates how to move an item automatically to a subfolder of the inbox as soon as you flag it as completed.

Last modified: 2006/01/18

NewInspector and Inspector_Activate

Some emal properties cannot yet be changed in the Newinspector event. See how to handle that situation.

Last modified: 2007/03/20

Open and Save Files

A sample for how to read and write the content of any file.

Last modified: 2006/01/20

Open Custom Form via your own Ribbon

With a button for your templates you can open them with less clicks.

Last modified: 2010/10/13

Open Excel File from within Outlook

Open frequently used files with a single click directly from Outlook.

Last modified: 2010/10/13

Pause Code Execution

In Excel there's a function to stop the code execution for a determined time, which is missing in Outlook. See how to use the Sleep function of the Win32 API.

Last modified: 2007/07/20

Place the Cursor Into a Message

Via the Outlook object model you cannot set the focus to a specific control. This sample demonstrates how to do it with the Win32 API.

Last modified: 2006/01/30

Print Attachments Automatically

See how to print automatically the attachments you receive.

Last modified: 2006/01/18

Print Emails Automatically

This sample prints every new email.

Last modified: 2007/03/24

Prompt for Missing Subject Before Sending

Another sample for how to check for certain properties before sending an email.

Last modified: 2008/06/19

SAM SAM
SAM automatically sets the sending account, or sender address, and folder for sent items based on several criteria.
Reactivate Task Reminders

This macro turns reminders of task items on.

Last modified: 2007/02/26

Remove Brackets from Call Number

Outlook 2013 adds automatically brackets around the area code. This script deletes the brackets.

Last modified: 2015/03/10

Remove Text From Email Subject

This script clears the subject of an email and removes any phrase you want.

Last modified: 2015/02/13

Remove the Quotation Marks from a Sender

This VBA macro removes the needless quotation marks from sender addresses so you can reasonably group that field.

Last modified: 2013/09/18

Reply to an Email With a Template

This sample explains the basics for replying with a template.

Last modified: 2006/01/19

Request an Email Read Receipt

See how to request a read receipt based on the recipient of the message.

Last modified: 2008/11/19

Rule Assistent and Lower Cases

If you create a rule to move a new email automatically to another folder, the rules wizzard ignores upper/lower cases. This script doesn't ignore the subtle distinction.

Last modified: 2015/03/14

Run-a-Script Rule

This explains the basics for writing macros that can be run by a rule.

Last modified: 2006/12/11

Save Emails to the File System

The sample saves incoming emails as *.msg files to the file system.

Last modified: 2006/01/19

Save Multiple Attachments to the File System

This sample saves the attachments of all selected emails to the file system.

Last modified: 2012/07/29

Security Model, Part 1

Avoid security alerts when accessing blocked properties or sending an email.

Last modified: 2007/12/18

Security Model, Part 2

With this little trick you can send emails via Outlook from, for instance, Excel without raising the security prompt in Outlook.

Last modified: 2007/12/19

Send a Copy of Every Email to Yourself

This example sends a copy of each outgoing email to another address. The address is added as BCC so the recipient doesn't see that.

Last modified: 2009/11/17

Send a Word Document As an Attachment

See how to send a document from within Word without blocking the Outlook window.

Last modified: 2014/10/14

Send an Email Template

This sends not the draft itself but a the copy of it so you can reuse the draft.

Last modified: 2007/02/22

Send and Delete Email

Send particular emails without saving a copy in your Sent Items folder.

Last modified: 2006/12/06

Send Emails Automatically

See how to send emails automatically and regularly at certain intervals.

Last modified: 2006/01/19

Send New Appointments Automatically by Email

Get a notification by email as soon as someone adds an appointment to your calendar.

Last modified: 2006/11/10

Set the Expiry Date for an Email

Set the expiry date with a single click for those emails you want to keep for just a certain time.

Last modified: 2007/09/21

OLKeeper OLKeeper
OLKeeper reliably prevents users from closing their Outlook window and thus possibly missing reminders or e-mails.
Sort Contacts by Birthday

This script creates a birthday list correctly sorted by day and month, and ignoring the year of birth.

Last modified: 2013/02/01

Trigger Actions With Categories

Categories qualify very well for triggering certain actions. See how to build your own Quick Steps.

Last modified: 2008/10/17

Use a Word Macro in Outlook

Outlook doesn't have a macro recorder, however, you can use many of the macros recorded in Word in Outlook, too.

Last modified: 2012/09/06

▲ Top