Code Samples

This category contains code samples put together to solve a specific user’s problem. The pages may not have detailed instructions for use.

Selectively change message format when replying

Selectively change message format when replying

How to change the message format on selected messages when replying. You can also use a Run a Script rule to change the message format as messages arrive.

Copy attachment names when replying

Copy attachment names when replying

Use a macro to copy attachment names from the original message to the reply or reply all in HTML or plain text messages.

Process items in a shared mailbox

Process items in a shared mailbox

You can't run rules on a shared mailbox and client-side rules in a mailbox won't run if Outlook is not open. Use an ItemAdd macro to watch the folder for new items.

Foward a message and CC the original recipients

Foward a message and CC the original recipients

A visitor to the Microsoft Answers forum asked about forwarding a message and automatically CCing it to the original recipients.

Shortcuts to open Outlook folders

Shortcuts to open Outlook folders

Outlook doesn't support creating shortcuts to folder on the Quick Access toolbar (QAT) or ribbon, but you can put macro on the QAT or ribbon that opens a folder.

Moving Deleted Items

Moving Deleted Items

Moving deleted items from the Deleted Items folder using Quick Steps or a macro.

Create Tasks from Email and move to different Task folders

Create Tasks from Email and move to different Task folders

Use this macro to create tasks from email messages and move them to different task folders.

Select multiple calendars in Outlook

Select multiple calendars in Outlook

Use VBA to select multiple calendars in overlay mode. Can deselect iCloud calendars using this code. Code Sample included.

Use a macro to open the Calendar to appointment date

Use a macro to open the Calendar to appointment date

Macro to replace the Go To Date feature of Outlook's Calendar. From an open appointment, run the macro. The calendar opens to the date of the appointment.

Paste formatted text using VBA

Paste formatted text using VBA

Use Microsoft Word’s ‘use source formatting’ paste command to paste formatted text into an Outlook item body.