How to attach files to your templates

In Shared Email Templates for Outlook

On this page, you will find several ways to attach a file to your templates in Shared Email Templates. You can attach files from OneDrive, SharePoint, URL or create an Outlook draft, attach a file to it, and use this draft as a template. Also, you can use a special macro that will remind you to attach a file from your local storage each time you use a certain template.

Here is a quick How to attach files cheat sheet, click on the button below to download it:

Download cheat sheet

Note. Please note, you may face limitations in size and number of attachments that are different in Office 365, Outlook.com, and Exchange Server.

Attach file from OneDrive

The first way to add a file to your template is to attach one from OneDrive with the help of the ~%AttachFromOneDrive macro. To use the macro, open your template and click the Insert macro icon:
Click the Insert macro icon.

In the drop-down list, select the ~%AttachFromOneDrive macro:
Select AttachFromOneDrive.

Tip. You can find the detailed manual on how to use macros here: How to use macros in your templates

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:
Select a file to attach from OneDrive.

Tip. You can switch to another OneDrive account by clicking the Blue Cloud icon on the right.

When you use a template with this macro, the macro downloads the chosen file and attaches it to the currently open email message.

Note. 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.
Tip. 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.
Tip. When the macro is created, you can click on it and select to Open file or Open folder:
Open file or open folder from OneDrive.

Attach file from SharePoint

Also, you can use the ~%AttachFromSharePoint macro to attach a file from your SharePoint:
Select AttachFromSharePoint.

When you pick this macro, if single sign-on is turned off, the add-in will ask to log in to your SharePoint account. Choose a file to attach:
Select a file to attach from SharePoint.

Tip. You can switch to another SharePoint account by clicking the Switch SharePoint account icon on the right.

Note that when you use a template with this macro, you have to be logged in to SharePoint so that the macro has access to the file.

Note. 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.
Note. Please note, ~%AttachFromSharePoint will not work on free accounts, such as Outlook.com, as they do not have SharePoint.
Tip. When the macro is created, you can click on it and select to Open file or Open folder:
Open file or open folder from SharePoint.

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:
Requested permissions.

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 Profile.

Click Edit Account:
Edit Account.

Here is the checkbox you need:
Single sign-on checkbox.

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.

Note. Please note, the single sign-on feature:

  • 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

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.

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:
Select AttachFromURL.

In the macro inserted into your template, add a link to the required file between the square brackets, e.g. ~%AttachFromURL[https://domain.com/file-url]

Note. 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.

What not to do while attaching files from URL

Friends, please, if you want to attach a file from OneDrive or SharePoint, 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.

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:
Select ~%WhatToAttach.
When inserting this macro into your template, fill in Window title with a word or phrase that will prompt you for the necessary file afterwards:
Insert Window title.
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:
Select a file to attach from local storage.

You can find plenty of useful information on this topic in our blog articles:

Post a comment

Seen by everyone, do not publish license keys and sensitive personal info!

If you have any questions or issues with this add-in, please feel free to post your concerns in the comments area. As soon as we answer, a notification message will be sent to your e-mail. If you do not want to share your thoughts in public, please contact us at support@ablebits.com.