The articles listed below contain VBA code samples. Additional code samples are listed at Developer Samples
How to use an Outlook macro to move or delete messages containing spammy keywords.
How to use VBA to 'do something' in Outlook's non-default folders.
How to get a count of the messages you have selected in Outlook, using a macro or copy and paste.
How to use Outlook's Rules Wizard Run a Script action to process messages using VBA. Using Run a Script rules will allow you to use actions not available in the Rules Wizard.
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.
A user wanted to know how to create an AND rule: If the subject contains outlook AND word, do something For example: "outlook AND word" to match on a Subject line of "Mail merge Outlook and Word", but not "Outlook Teams Meeting" While Outlook Rules don't support AND within a rule, you can make it
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
An Outlook user asked how to automatically change the subject of a message and forward it to another address. Using a "run a script" rule is one option and we show you how to do it.
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
How to use a macro to set up an Automatic reply (out of office reply) in Outlook on Windows desktop.
Basic instructions on using Outlook's VBA editor: how to open it, where to put the code, how to sign your code.
Martin asked how to change the font in the Notes field only in Contacts, but not in the other Outlook items types. Easy: use stationery for your email messages, or VBA to change the font for certain item types. I'll show you how.
The following code saves the attachments from selected messages but does not delete the attachments from the message(s). This VBA code is based on the code sample from my Outlook book: Save and Delete Attachments. Use it if you want to save the attachment, add a link to the saved file, and delete the attachment
Use this VBA macro as an alternative to DocMessageClass for changing an Outlook item's message class.
The code behind Microsoft Outlook forms is always written with the Microsoft Visual Basic Scripting Engine, better known as VBScript, a small portable language, which is also used in web pages and standalone scripts. VBScript does not support the built-in Outlook constants, such as olFolderContact. Only the constants built into VBScript, such as vbYes, are supported. For