FAQ 000162 – How to create a custom ribbon button in Outlook 2016

This article applies to:

Outlook 2016, Office VBA

In this document I will show you how to create a custom ribbon button in Outlook.

We will create a simple button that adds a tag [SecureMail] to the subject of a new email message.

In order to achieve this, we have to complete following major steps.

  1. Enable developer features in Outlook.
  2. Write a macro which will do the modification of the subject.
  3. Create a custom group/button in the Outlook ribbon.
  4. Attach the macro to the button.

Here are the detailed steps:

1) Enable the Developer Tab in Outlook. Open File->Options->Customize Ribbon. Check the Developer Tab.

2) Click on the Developer Tab.

3) Select Visual Basic.

4) Select Project1->Microsoft Outlook Objects->ThisOutlookSession

5) Paste the following code into the editor:

Copy to Clipboard

.

6) Click on the Save button to save your macro and close Editor.

Now we need to attach your macro to a button on the Ribbon.

7) Open the New Message dialog by clicking on the New Message button.

8) Right-click on the empty part of the ribbon and select Customize the Ribbon…

9) Select New Mail Message and press the New Group button

10) Give a name to your new group by selecting New Group (Custom) and select the Rename.

11) Give it a name let’s say Secure Mail.

Now we will create our custom button and attach the macro we created to this button.

12) Select Choose Command from -> Macros

13) Select the Macro you created and by pressing Add attach it to your custom button.

14) Select the new button and press the Rename button to rename it.

15) Enter a name for your button and select an icon.

In the New Mailbox dialog box we now have a new icon group called Secure Mail and a button named Add SecureMail to Subject.

And if we press it, the text [SecureMail] will be added to the Subject as expected.

About the Author:

Dejan Foro
Dejan Foro is founder and CEO of Exchangemaster GmbH. He lives in Zurich, Switzerland and is a dedicated specialist, with 25 years of professional work experience in IT. Before starting Exchangemaster GmbH he worked for 20 years as a system engineer and project manager with customers of all sizes across many industries: From small ISV startups and a NGO humanitarian organizations up to largest international corporations like Stryker, Swisscom, British Telecom and Nyrstar. He spent his entire career delivering Microsoft based infrastructure solutions with main focus on Active Directory and Exchange. During those years, he collected a valuable work experience on 7 Exchange generations (2016, 2013, 2010, 2007, 2003, 2000 and 5.5) and has delivered services to a user base of about 3.2 million mailboxes in on-premise, hybrid and Office 365 deployments. Beside working on customer projects, he is a regular speaker and expert at Microsoft conferences and user groups. As a Microsoft Certified Trainer he teaches Microsoft Official Curriculum courses to technical professionals around Europe. For his work he has received numerous awards. In 2005 he was the first member to be elected into the MCP Hall of Fame by Windows IT Pro Magazine readers choice (as 1 of 6 worldwide). From 2005-2017, Dejan has been awarded by Microsoft Corporation with the yearly Microsoft Most Valuable Professional award in area of Exchange for 12 years in a row (one of approximately 100 worldwide and the only 1 such in Switzerland).

Leave A Comment