• Outlook User
  • Exchange Admin
  • Office 365
  • Outlook Developer
  • Outlook.com
  • Outlook Mac
  • Common Problems
    • Outlook BCM
    • Utilities & Addins
    • Video Tutorials
    • EMO Archives
    • Outlook Updates
    • Outlook Apps
    • Outlook & iCloud Issues
    • Forums

How to Open Outlook Templates and Files using Toolbar Buttons

Slipstick Systems

› Outlook › How to Open Outlook Templates and Files using Toolbar Buttons

Last reviewed on February 13, 2018   —  112 Comments

August 29, 2011 by Diane Poremsky 112 Comments

When you want to open a template, you need to go through the Choose Form dialog, which is a few more steps than most users want to take. In older versions of Outlook you could create Hyperlink buttons but Outlook 2010 and newer doesn't support hyperlink buttons and tighter security in Outlook 2007 means you need to respond to a warning dialog before the template (or hyperlinked file) opens.

We have solutions for both problems: a macro for Outlook 2010 and newer (also works with Outlook 2007) and a registry key to disable the warning in Outlook 2007.

See Disable the Unsafe Hyperlink Warning when Opening Attachments for the instructions to disable the warning dialog and the Open or Save dialog. Use this registry value with Outlook 2010 if you add files to Outlook's Shortcut navigation pane.

Open templates using a toolbar button

To create a button on the toolbar that will open a template in Outlook 2010 and up, you need to use a macro as it does not support hyperlink buttons found in older versions of Outlook. Additionally, opening a template hyperlinked to a toolbar button in Outlook 2007 brings up a security dialog.

Template warning

Note: if the template contains custom fields, the customizations will be disabled and the template will be blank. These templates need to be opened using the Choose Form dialog.

The solution

Create a macro that replicates opening a template from the Choose Form dialog using the Application.CreateItemFromTemplate method:

Sub MakeItem()
Set newItem = Application.CreateItemFromTemplate("c:\path\template.oft")
newItem.Display
Set newItem = Nothing
End Sub 

Press Alt+F11 to open Outlook's VB Editor then copy and paste this macro into ThisOutlookSession. Add it to the ribbon or QAT. See How to use the VBA Editor for complete instructions to use the VB Editor. See Customize the QAT if you need help customizing the QAT.

If you want to use a macro to open different templates, assign the template path to a variable and pass the variable to the macro, like this:

Dim template As String

Sub OpenTemplate1()
template = "C:\Users\Diane\Templates\template1.oft"
MakeItem
End Sub

Sub OpenTemplate2()
template = "C:\Users\Diane\Templates\email.oft"
MakeItem
End Sub

Private Sub MakeItem()
Set newItem = Application.CreateItemFromTemplate(template)
newItem.Display
Set newItem = Nothing
End Sub

Open a Template and Add an Attachment

If you want to add an attachment to the message at the same time you open the template, you'll use newItem.Attachments.Add "C:\myfile.doc". Add it to your code after the line that opens the template (DUH!) and before the message is displayed (newItem.Display).

The macro will look something like this:

Sub AddAttachment ()
Dim newItem as Outlook.MailItem
Set newItem = Application.CreateItem("C:\path\template.oft")
newItem.Attachments.Add "C:\myfile.doc"
newItem.Display
End Sub

 

Open a published form

If you want to open a published form, use this code to call the form. You need to be viewing the folder you want the item to be saved in.

Use GetDefaultFolder function to use the default folder for the custom form type. For example, change the Set items line to this the following to create an appointment or meeting in the Calendar folder from any other folder:
Set Items = Session.GetDefaultFolder(olFolderCalendar).Items

Public Sub OpenPublishedForm()
   Dim Items As Outlook.Items
   Dim Item As Object
   Set Items = Application.ActiveExplorer.CurrentFolder.Items
   Set Item = Items.Add("ipm.note.name")
   Item.Display
 End Sub

 

Add a button to the ribbon tutorial

This tutorial shows you how to add a button to one of Outlook 2013's ribbon tabs. If you prefer to add them to the Quick Access Toolbar (QAT), the steps are the same but you'll start in File, Options, Quick Access Toolbar. Note: In Outlook 2010 you cannot add buttons to the ribbon but you can add buttons to the QAT.

  1. Select Macros from the Choose commands from menu
  2. Select the macro. Only Public macros that you can run manually will be listed here.
  3. Click Add to add it to the QAT (or ribbon)
  4. To change the icon and display name, click Modify.

After you add a macro the ribbon, you cannot move the macro or change the macro or module name. If you do, you'll need to recreate the macro.

add macros to the qat or ribbon

 

Create a Hyperlink button

This works in Outlook 2007 and older versions as well as all Office applications that have the Assign Hyperlink option on customized buttons. You can hyperlink to any file, although programs (*.exe) may be restricted for security reasons.

Assign a hyperlink to a button

You can use any button in the Customize dialog (select a category on the left to see additional buttons). If you want to create a menu button, there is a blank one in the New Menu category.

  1. Right click on the toolbar area.
  2. Choose Customize
  3. From the Commands tab, drag a button (any button) to the Menu bar or a Toolbar
  4. Right click on the button to expand the customize menu
  5. Click Assign Hyperlink then Open and select the file you want to open.

Video Tutorial

In Outlook 2007's main interface and in Outlook 2003 and older, you'll add a button to the toolbar as shown in the following video.

 

Disable the hyperlink warning

When you open templates or files using a hyperlink button or from Outlook's Shortcut navigation pane, you'll receive an unsafe hyperlink warning. You can disable the warning by editing the registry.

Unsafe file warning

You may also receive the file open or save dialog when using a hyperlink button or shortcut. To disable this dialog when the "Always ask" field is grayed out, run Outlook as administrator. The "always ask" checkbox should be clickable. If not, you'll need to edit the registry for each file type. See Disable "Always ask before opening" dialog for more information.

Open or Save dialog

The solution

Add a registry value to disable the warning dialog.

Open the registry editor and browse to the following registry subkey for
Outlook 2016:
HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Security

Outlook 2013:
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\Security

Outlook 2010:
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\Security

Outlook 2007:
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\Security

Note: If the Security key does not exist in your registry, you'll need to create it too.

Right click on Security key and choose New, DWORD. Type (or paste)

DisableHyperlinkWarning as the Value name then double click on it. Enter 1 as the Value data to disable the warning. Delete the key or use a value of 0 to enable the warning.

Change the registry value

Group policy keys for administrators

Administrators will add the DisableHyperlinkWarning DWORD to the Policy key instead:

Outlook 2016:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\Common\Security

Outlook 2013:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\15.0\Common\Security

Outlook 2010:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\14.0\Common\Security

Outlook 2007:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Common\Security

Do It For Me

If you don't want to edit the registry yourself, you can download and run the following registry key for your version of Outlook.

Outlook 2016Outlook 2013Outlook 2010
Outlook 2007

How to use the macros on this page

First: You need to have macro security set to the lowest setting, Enable all macros during testing. The macros will not work using the options that disable all macros or unsigned macros. You could choose the option to warn about macros and accept it each time you restart Outlook, however, because it's somewhat hard to sneak macros into Outlook (unlike in Word and Excel), allowing all macros is safe, especially during the testing phase. You can sign the macro when it is finished and change the security to allow signed macros.

To check your macro security in Outlook 2010 and newer, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, look at Tools, Macro Security.

After you test the macro and see that it works, you can either leave macro security set to low or sign the macro.

Open the VBA Editor by pressing Alt+F11 on your keyboard.

To put the code in a module:

  1. Right click on Project1 and choose Insert > Module
  2. Copy and paste the macro into the new module.

More information as well as screenshots are at How to use the VBA Editor

More Information

To add a toolbar button to launch an Outlook form (OutlookCode.com)
Outlook 2010: Open custom form via your own ribbon (vboffice.net) VBA sample to open custom form
Opening a Saved Outlook Template (.oft file) in Office
2003 and 2007
Whitepaper by Helen Feddema
How to enable or to disable hyperlink warning messages in 2007 Office programs and in Office 2010 programs (MSKB)
How to disable hyperlink warning messages in Office 2003 (MSKB)

How to Open Outlook Templates and Files using Toolbar Buttons was last modified: February 13th, 2018 by Diane Poremsky
  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on Google+ (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Share on Skype (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to print (Opens in new window)

Related Posts:

  • Disable the Unsafe Hyperlink Warning when Opening Attachments
  • How to add shortcuts to applications on the Shortcut Bar
  • Customize the Outlook Toolbar, Ribbon or QAT
  • Do you send a lot of messages to one person or group and want to make
    How to create preaddressed messages

About Diane Poremsky

A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Leave a Reply

112 Comments on "How to Open Outlook Templates and Files using Toolbar Buttons"

2500
Photo and Image Files
 
 
 
Audio and Video Files
 
 
 
Other File Types
 
 
 
2500
Photo and Image Files
 
 
 
Audio and Video Files
 
 
 
Other File Types
 
 
 

  Subscribe  
newest oldest most voted
Notify of
Troy
Troy
Share On TwitterShare On Google

I've looked for this so long - thanks a ton! Now trying to expand a bit to include multiple templates/macros but not following how to add. I'm able to duplicate the code changing the path to the macro I want to use and append it in the VB editor under my project. I'm then able to add that to the ribbon. But when I go to click on the 2nd macro template it doesn't do anything. The first one continues to work however. Suggestions?

Snippet of my VB Code:

Sub MakeItemScheduling()
Set newItem = Application.CreateItemFromTemplate("C:pathto1st.oft")
newItem.Display
Set newItem = Nothing
End Sub
Sub MakeItemProjectCompletion()
Set newItem = Application.CreateItemFromTemplate("C:pathto2nd.oft")
newItem.Display
Set newItem = Nothing
End Sub

Vote Up00Vote Down Reply
November 16, 2017 9:59 am
Diane Poremsky
Diane Poremsky
Share On TwitterShare On Google

As long as the path it correct, it should work. Add msgbox "MakeItemProjectCompletion" right before set newitem and see if the dialog box comes up. if so, copy the template path and paste it into windows explorer - does the template open?

Vote Up00Vote Down Reply
November 16, 2017 12:11 pm
Troy
Troy
Share On TwitterShare On Google

Hi Diane - well I went back and re-read your original instructions and was able to get it working with the following:

Dim template As String

Sub OpenTemplate1()
template = "C:\Users\Troy\AppData\Roaming\Microsoft\Templates\SchedulingTemplate.oft"
MakeItem
End Sub

Sub OpenTemplate2()
template = "C:\Users\Troy\AppData\Roaming\Microsoft\Templates\ProjectCompletion.oft"
MakeItem
End Sub

Private Sub MakeItem()
Set newItem = Application.CreateItemFromTemplate(template)
newItem.Display
Set newItem = Nothing
End Sub

Thanks for the quick reply and appreciate you sharing these.

I would also add I've taken this a step further to use the self-signed Cert in Office and digitally signing it to the VB project which makes the pop-ups go away as the macros are now trusted. https://www.groovypost.com/howto/howto/office-2010-outlook-self-signed-digital-certificate/

Thanks!!!

Vote Up00Vote Down Reply
November 16, 2017 1:52 pm
Diane Poremsky
Diane Poremsky
Share On TwitterShare On Google

you don't want to sign the macros until after you are 100% sure its working - each time you edit a macro, you need to remove and re-sign the macro. (My instructions are at Using SelfCert to sign a macro

Vote Up00Vote Down Reply
November 16, 2017 2:56 pm
Kylie
Kylie
Share On TwitterShare On Google

I might be missing something, but I have a simple workaround. Open a blank custom template, such as a task template, with the name of the template in the subject field for easy identification. Save it. It will appear in the task list. Copy and paste it multiple times and you will have plenty of blank templates ready to edit with a single click.

Vote Up00Vote Down Reply
June 19, 2017 9:16 pm
Diane Poremsky
Diane Poremsky
Share On TwitterShare On Google

That's fine if you don't mind having blank items hanging around. You could also copy the template from the file system and paste it in an Outlook folder - when you open it, it creates a new item.

Vote Up00Vote Down Reply
June 19, 2017 11:18 pm
Dave
Dave
Share On TwitterShare On Google

Is there a simple way to integrate the FROM field into the macro? I would like
to open my .oft file using a different FROM email address that I have Send on Behalf Of rights to (not Send As). Thanks.

Sub MakeItem()
Set newItem = Application.CreateItemFromTemplate("c:pathtemplate.oft")
newItem.Display
Set newItem = Nothing
End Sub

Vote Up00Vote Down Reply
June 5, 2017 2:05 pm
Diane Poremsky
Diane Poremsky
Share On TwitterShare On Google

Yes - before newitem.display, you set the account. https://www.slipstick.com/developer/send-using-default-or-specific-account/ shows how - for send on behalf of, use newitem.SentOnBehalfOfName = "alias@domain.com"

Vote Up00Vote Down Reply
June 19, 2017 11:30 pm
Heather
Heather
Share On TwitterShare On Google

Thank you for this, it worked like a charm. However, the new group (which I named Templates) is huge. How can I make the icons smaller/compact? The icons (macro icons) appear to be full-sized, and the full template name is displayed. I'd love it if I could get them simply with abbreviated template names and/or smaller icons. Is there a way to set/limit the size of my new group? Thank you!

Vote Up00Vote Down Reply
February 21, 2017 5:38 pm
Diane Poremsky
Diane Poremsky
Share On TwitterShare On Google

After adding the buttons to the ribbon, you can rename them and change the icon - click the Rename button. The size is automatic - I'm not sure how outlook decides to go small but how crowded the ribbon is is one cause. The first button in a group might be large, additional ones small. Not sure if display name has an effect - but the ones i renamed with longer names seen to be small (when the ribbon is crowded.).

Vote Up00Vote Down Reply
February 27, 2017 1:26 am
Janine White
Janine White
Share On TwitterShare On Google

This is exactly what I was looking for. Thank you!

One thing that it would be helpful to include is that the macros will be visible when Macros is selected in the Customize QAT dropdown list. It's simple, but it took me a little while to figure out how to add them once I entered the code.

Vote Up00Vote Down Reply
January 25, 2017 2:29 pm
Christine_A
Christine_A
Share On TwitterShare On Google

I came up with an alternate solution that doesn't involve any macros. Using the Shortcuts icon at the bottom of Outlook, I created shortcuts to my favorite templates by dragging them from their folder into the Shortcuts group, and now I can access them all with just one click. You can also add the Shortcuts icon to your ribbon at the top by customizing the ribbon, creating a new ribbon group, and adding Shortcuts from All Commands to it if desired. It also works if you want to create a folder in your Documents for all your Outlook templates and then just drag the whole folder itself into the Shortcuts group. I don't know if this helps anyone, but to me, it's easier than creating macros, although I do know how to do those too.

Vote Up10Vote Down Reply
December 28, 2016 4:51 pm
Diane Poremsky
Diane Poremsky
Share On TwitterShare On Google

It's not really easier - unless your company doesn't allow macros, then it's your only option. It doesn't work with custom forms and macros can pick up content from selected items to customize the message. For example, if you are using templates to send replies, you can get the name and address from the selected message or select a contact and open the message addressed to the contact.

Vote Up00Vote Down Reply
January 25, 2017 5:15 pm
Tiago
Tiago
Share On TwitterShare On Google

Hello, thank you for this explanation.

Does this work with custom forms for calendar events too? I have several of these forms published in my Personal Forms Library, but I can't find the path to them. Can you help me? Thank you.

Vote Up00Vote Down Reply
December 2, 2016 5:36 am
Diane Poremsky
Diane Poremsky
Share On TwitterShare On Google

Yes, it will. You'll use the version lower on the page that works for custom forms - change this line to use the IPM.Appointment.customname you are using:
Set Item = Items.Add("ipm.note.name")

Vote Up00Vote Down Reply
January 25, 2017 5:09 pm
Johnny
Johnny
Share On TwitterShare On Google

Appled the Multiple Template VBA , only the first one opens the second one does not: Run time error 2147287038 (800300002) Cannot open file , the file is in the same folder as the first one. C:\Users\Username\AppData\Roaming\Microsoft\Templates\2nd.oft. ...help???

Vote Up00Vote Down Reply
June 22, 2016 4:15 pm
Diane Poremsky
Diane Poremsky
Share On TwitterShare On Google

The template opens ok if you paste the path into the address bar of windows explorer? Try changing the filename to something with all lower case letters and see if it works. Also check the file permissions.

Vote Up3-3Vote Down Reply
June 24, 2016 6:06 pm

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 23 Issue 10

Subscribe to Exchange Messaging Outlook






Our Sponsors

  • Popular
  • Latest
  • Week Month All
  • This operation has been cancelled due to restrictions This operation has been cancelled due to restrictions
  • Adjusting Outlook's Zoom Setting in Email Adjusting Outlook's Zoom Setting in Email
  • How to Remove the Primary Account from Outlook How to Remove the Primary Account from Outlook
  • Pictures Don't Display in Outlook Messages Pictures Don't Display in Outlook Messages
  • Outlook is Not Recognized as the Default Email Client Outlook is Not Recognized as the Default Email Client
  • To Cc or Bcc a Meeting Request To Cc or Bcc a Meeting Request
  • Remove a password from an Outlook *.pst File Remove a password from an Outlook *.pst File
  • The Signature or Stationery and Fonts button doesn't work The Signature or Stationery and Fonts button doesn't work
  • Understanding Outlook's Auto-Complete Cache (*.NK2) Understanding Outlook's Auto-Complete Cache (*.NK2)
  • Exchange Account Set-up Missing in Outlook 2016 Exchange Account Set-up Missing in Outlook 2016
  • iCloud error: Outlook isn't configured to have a default profile iCloud error: Outlook isn't configured to have a default profile
  • Setting Custom Reminder Times Setting Custom Reminder Times
  • Add Additional Addresses to Room Mailboxes Add Additional Addresses to Room Mailboxes
  • Create a Task from a Message and include the Attachment Create a Task from a Message and include the Attachment
  • Forward email messages by date Forward email messages by date
  • Open multiple Outlook windows when Outlook starts Open multiple Outlook windows when Outlook starts
  • Office 365 Fraud Detection Checks Office 365 Fraud Detection Checks
  • Outlook Request: Calendar Details View Outlook Request: Calendar Details View
  • Outlook's "Not Junk" option isn't available Outlook's "Not Junk" option isn't available
  • Outlook Tip: Show all Mondays in the Calendar Outlook Tip: Show all Mondays in the Calendar
Ajax spinner

Newest VBA Samples

Open multiple Outlook windows when Outlook starts

Set most frequently used Appointment Time Zones

How to change the From field on incoming messages

VBA: File messages by client code

Update Contact Area Codes

Set a reminder on selected items in the To-Do List

Replicate GTD: Create a task after sending a message

Use VBA to read fields in attached messages

Move Outlook Folders using VBA

Replicate Smart Lookup using a macro

Recent Bugs List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in Outlook for Windows.

Windows 10 Issues

  • iCloud, Outlook 2016, and Windows 10
  • Better Outlook Reminders?
  • Coming Soon to Windows 10: Office 365 Search
  • Outlook Links Won’t Open In Windows 10
  • BCM Errors after Upgrading to Windows 10
  • Outlook can’t send mail in Windows 10: error Ox800CCC13
  • Missing Outlook data files after upgrading Windows?

Outlook 2016 Top Issues

  • The Windows Store Outlook App
  • Emails are not shown in the People Pane (Fixed)
  • Calendars aren’t printing in color
  • The Signature or Stationery and Fonts button doesn’t work
  • Outlook’s New Account Setup Wizard
  • BCM Errors after October 2017 Outlook Update
  • Excel Files Won’t Display in Reading Pane
  • Outlook 2016: No BCM
  • Exchange Account Set-up Missing in Outlook 2016

VBA Basics

How to use the VBA Editor

Work with open item or selected item

Working with All Items in a Folder or Selected Items

VBA and non-default Outlook Folders

Backup and save your Outlook VBA macros

Get text using Left, Right, Mid, Len, InStr

Using Arrays in Outlook macros

Use RegEx to extract message text

Paste clipboard contents

Windows Folder Picker

Custom Forms

Designing Microsoft Outlook Forms

Set a custom form as default

Developer Resources

Developer Resources

Developer Tools

Outlook-tips.net Samples

VBOffice.net samples

OutlookCode.com

SlovakTech.com

Outlook MVP David Lee

MSDN Outlook Dev Forum

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes
  • “Live” Group Calendar Tools

Convert to / from Outlook

  • Converting Messages and Calendar or
    Address books
  • Moving Outlook to a New Computer
  • Moving Outlook 2010 to a new Windows computer
  • Moving from Outlook Express to Outlook

Recover Deleted Items

  • Recover deleted messages from .pst files
  • Are Deleted Items gone forever in Outlook?

Outlook 2013 Absolute Beginner's Guide

Diane Poremsky [Outlook MVP]

Make a donation

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Outlook Suggestion Box (UserVoice)

Slipstick Support Services

Contact Tools

Data Entry and Updating

Duplicate Checkers

Phone Number Updates

Contact Management Tools

Sync & Share

Share Calendar & Contacts

Synchronize two machines

Sharing Calendar and Contacts over the Internet

More Tools and Utilities for Sharing Outlook Data

Access Folders in Other Users Mailboxes

View Shared Subfolders in an Exchange Mailbox

"Live" Group Calendar Tools

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Outlook BCM | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Advertise | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2018 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.

You are going to send email to

Move Comment