On this page, you will find several ways to attach a file to your templates in Shared Email Templates. You can attach files with the help of the Add files option or with macros.
Files can be attached from OneDrive, SharePoint, URL. Also, you can create an Outlook draft, attach a file to it, and use this draft as a template.
If you need a reminder to attach a file from your local storage each time you use a certain template, use the ~%WhatToAttach macro.
Here is a quick How to attach files cheat sheet, click on the button below to download it:
Before you start
Please go over the notes below about the attachments and macros used for them.
- There are two ways to attach files: with the help of the Message Attachments option in the template editor or by using macros. Please note, these are two different processes, so files that you attach with the help of macros won't be displayed in the Message Attachments window.
- You may face limitations in size and number of attachments that are different in Office 365, Outlook.com, and Exchange Server.
- To avoid signing in to your Microsoft account each time you attach files from OneDrive or SharePoint, enable the SSO option. Here are more details.
- If you use ~%AttachFromOneDrive in a template that is shared with other users, make sure that your teammates have access to the file or folder in OneDrive. You can learn more about managing access in OneDrive on the Share OneDrive files and folders page. You can create a special folder in your OneDrive, share it with all your teammates, and collect all the documents you share in templates there.
- If you use ~%AttachFromSharePoint in a template that is located in a team and shared with other users, make sure that your teammates have access to the file or folder in SharePoint. You can learn more about managing access in SharePoint on the Share SharePoint files or folders page.
- When you use a template with the ~%AttachFromOneDrive or ~%AttachFromSharePoint macro, the macro downloads the chosen file and attaches it to the currently open email message.
- When you use a template with the ~%AttachFromSharePoint macro, you have to be logged in to SharePoint so that the macro has access to the file.
- ~%AttachFromSharePoint will not work on free accounts, such as Outlook.com, as they do not have SharePoint.
- If you use the ~%AttachFromURL macro in a template that is shared with other users, make sure that your teammates have access to the URL you indicate in the macro.
Add attachments in template editor
To select files to be attached when you use a certain template, click the Message Attachments icon:
Decide whether you will attach a file from OneDrive, SharePoint, or URL and click Plus on the right:
Attach from OneDrive
If the file is in OneDrive, select it and click Select. Also, you can Upload a file from your local storage to OneDrive and then attach it:
Click Close:
If there are some files attached, the icon will be marked with a blue dot:
You can click on the icon again to see the list of all files attached or add more ones.
Attach from SharePoint
If the file is in SharePoint, select it and click Select. Also, you can Upload a file from your local storage to SharePoint and then attach it:
Click Close:
Attach from URL
Enter the URL and click Add:
Click Close:
Attach files with macros
Another way is to attach files with the help of macros. You can find the detailed manual on how to use macros here: How to use macros in your templates
Attach file from OneDrive
You can attach a file from OneDrive with the help of the ~%AttachFromOneDrive macro. Click the Insert Macro icon:
Into the Search box, type "attach" to look for the macro. Double-click ~%AttachFromOneDrive or select it and click Select:
If single sign-on is disabled, the add-in will ask you to log in to your OneDrive account.
Choose a file to attach to your email and click Select. Also, you can Upload a file from your local storage to OneDrive and then attach it:
In your template, the macro will be shown by its placeholder:
Attach file from SharePoint
Also, you can use the ~%AttachFromSharePoint macro to attach a file from your SharePoint. Click the Insert Macro icon:
Into the Search box, type "attach" to look for the macro. Double-click ~%AttachFromSharePoint or select it and click Select:
When you pick this macro, if single sign-on is turned off, the add-in will ask to log in to your SharePoint account.
If the file is in SharePoint, select it and click Select. Also, you can Upload a file from your local storage to SharePoint and then attach it:
After you insert the macro into your template, the macro placeholder will appear there:
Attach file from URL
Another way to add a file to your template is to attach a file from a URL by using the ~%AttachFromURL macro.
Click the Insert Macro icon:
Into the Search box, type "attach" to look for the macro. Double-click ~%AttachFromURL or select it and click Select:
In the macro's dialog window, enter a link to the required file, e.g. https://domain.com/file-url, and click OK:
What not to do while attaching files from URL
Please, if you want to attach a file from OneDrive or SharePoint with the help of a macro, use the ~%AttachFromOneDrive and ~%AttachFromSharePoint macros only.
Do not try to use the ~%AttachFromURL macro and put a link to your file from OneDrive or SharePoint into square brackets.
For instance, you may open your file in a browser, copy its address from the address bar, and try to use it in the ~%AttachFromURL macro. This won't work. Also, if you copy a link to your file while sharing it in OneDrive and paste it into square brackets in the ~%AttachFromURL macro—this won't work too.
But if you are seeing the 'SSO is not supported in your current add-in version' message, most probably, you simply need to wait a bit till the app will be updated in your account. The speed of this process depends on Microsoft and we can't influence it.
Use Outlook draft with attached file
Besides, to attach a file to your template, you can use Outlook drafts as templates. In this case, you create a draft in Outlook, attach a file to it, and link the folder with this draft to Shared Email Templates. Here is our guide on how to use linked folders:
How to use Outlook drafts as templates
Attach file from local storage
To remind yourself to attach a file from your hard drive or SSD every time you use a certain template, apply the ~%WhatToAttach macro.
When inserting this macro into your template, fill in Window title with a word or phrase that will prompt you to attach the necessary file afterwards:
So, each time you insert a template that contains the ~%WhatToAttach macro into your email message, the add-in will ask you to select a file under a certain title. Click the Browse icon to pick it:
Single sign-on (SSO) for OneDrive and SharePoint
If you attach files from OneDrive or SharePoint and you've got only one OneDrive account that is the same as your Microsoft 365 Outlook account (that is indicated in Outlook File → Account information), you can take advantage of single sign-on to avoid entering or confirming your credentials each time you use the ~%AttachFromOneDrive and ~%AttachFromSharePoint macros.
With single sign-on, you will only once accept the permissions for the app:
After that, all files will be attached without any additional pop-ups.
Disable single sign-on
The single sign-on feature is turned on by default. If you may attach files from different OneDrive accounts, turn single sign-on off. For this, click the three dots in the bottom right corner of the add-in pane and select Profile:
Click Edit Account:
Here is the checkbox you need:
Important notes
Below the checkbox, you may see an error message in red, in most cases, the message would be connected to one of the listed below points.
- Is not supported in the web app–it is available only in the Outlook add-in (desktop or online).
- Is available only if your Outlook provides mailbox API 1.9 and higher.
- Works in Microsoft 365 accounts only and is not supported in free accounts, such as outlook.com or gmail.com
Useful links in our blog
You can find plenty of useful information on this topic in our blog articles: