These articles are in the Developer and Code Sample categories. These pages often contain only the code, with very little instructions and assume the reader has some VBA knowledge. See How to use the VBA Editor if you need help using VBA.
Additional code samples are at VBA Code Samples
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.
Delete Email from Specific TLDs
I'm often asked how to filter email from certain domains when at least part of the domain name changes. Outlook doesn't support wildcards in rules, so you can't filter newsletters that come from @s1.domain.com, @s2.domain.com etc, or filter spam from .info, .work or Top-level-domain. This sample macro to use with a run a script rule
Process Mail that was Auto Forwarded by a Rule
How to identify or "do something" with a message that was auto forwarded. While the info bar in the message identified it as auto forwarded, it' only visible when the message is selected.
Run a Script: Send Autoreply with Date
These code samples show you how to use a run a script rule to send an auto response, including the received date and when the recipient should expect a follow up response. The first sample uses a template for the reply, the second macro replies to the incoming message.
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.
Use VBScript to Export or Import Categories
The VBScripts on this page will export or import a list of your categories for backup and importing into your Outlook desktop mailbox.
Empty Multiple Deleted Items Folders using a Macro
The scenario: You have several email accounts, each with their own data file and you want to empty the deleted items in every data file with one click. The solution: a macro.
Search PDF Attachments and Forward
This macro uses Adobe Acrobat, not Reader or other PDF applications. This run a script macro will open an attached PDF file, look for a keyword and if found, forward the attachment. If the message you are forwarding contains external content, you may need to respond to a security dialog. In this case, you will
Change the Business Card layout using BusinessCardLayoutXml
How to quickly apply a business card layout to all Outlook contacts so they all use one layout.
Macro to add domains to the Safe Sender list
A user wanted to add domains to the Safe Senders list in Outlook, but the 'not junk' options added addresses, not domains. Sub WriteToJunkList() Dim objApp As Outlook.Application Dim ns As Outlook.NameSpace Dim objMail As MailItem Dim strDomain As String Dim strAddress As String Set objApp = Application Set objMail = objApp.ActiveExplorer.Selection.Item(1) strDomain = Right(objMail.SenderEmailAddress,
VBA: Change the From Account on Replies
A user wanted to always reply to messages sent to one account using another account. He also wanted to remove his address from the recipient list.
How to change the From field on incoming messages
How to use Redemption to change the sender's name field on messages.
Use VBA to move messages with attachments
Use a run a script rule or an ItemAdd macro to look for messages with attachments. When the attachment is a specific file type, do something with the message.
Set a reminder when accepting a meeting request
Use VBA to open an Outlook meeting request that was just added to the calendar after accepting the request in the Inbox. so you can set a reminder or make notes.
Dismiss reminders for past calendar events
Two macros to remove reminder from appointments. The first macro removes the reminders as the appointment is created in a specific calendar folder. The other macro removes reminders from older items.