How to attach OneDrive file to Outlook emails using Shared Email Templates

This blog article is a short guide on how to quickly attach a OneDrive file to your Outlook email using a macro in Shared Email Templates.

How I started using Shared Email Templates

Frankly speaking, I do not consider myself an experienced user but sending Outlook emails is an essential workflow of my everyday life. What about you? Now imagine how excited I was to get a new helpmate. Spend a few minutes of your time to read about Shared Email Templates or try it out to break your routine and reduce time spent on messages. The add-in is really handy since you can get access to this app from any device and work on Outlook for Windows, for Mac, or Outlook online. What I do: I make up my own templates, save them and use whenever I need, or create a team to share common patterns with my co-workers. What is even more amazing, the add-in lets you equip templates with multiple macros and personal shortcuts.

With the help of one of them, attaching OneDrive files to Outlook messages is not a headache anymore. You can insert your documents, images and videos smoothly, without doing it manually every time but only by clicking a template header:
Attaching a file to Outlook email with a macro

That’s easy and fast, isn't it? So, let us get into details to learn what exactly we need to do.

Sing in to OneDrive and create a place for sharing

OneDrive is a widely known and used cloud storage platform, yet, if you have never heard about it before I will give you a hint how to find it:

  1. Open your browser and sign in to office.com.
  2. Hit the launcher icon to view the installed apps.
  3. The Blue Cloud sign to the right of Outlook is what we are looking for, so go ahead and click on it.

How to open OneDrive

Note. If you are unlucky and OneDrive is not preinstalled by your Windows 10 please don’t give up, the instructions are here.

Keeping up with the line, we share created templates with our teammates in our Outlook add-in, hence we are to share the attachments included in them. The easiest solution would be to create a special folder in your corporate OneDrive to collect your files in one common place (personal OneDrive is not an option when you have a team, right?). Simply tap the New icon in the top menu to add a folder and name it as you wish:
Create OneDrive folder

To proceed and upload the necessary items double-click on your folder and use the Upload button, that is easy and quite clear:
Upload a new folder into OneDrive

BTW, you can simplify the matter by just opening your File Explorer, selecting the files you want to upload, and dragging them to OneDrive window.

How to share a OneDrive folder correctly

If you are done uploading, right-click on your folder and you will be provided with the set of options and choose Manage access:
Upload a new folder into OneDrive

Move to Direct Access to include the names of the teammates who will work with these attachments:
Grant access to OneDrive folder

Feel free to manage their editing permissions on the spot if required.

Now hit Grant access to wind up everything and the attached files would be available for your colleagues when applying the templates.

For more information, please see:

Use the ~%ATTACH_FROM_ONEDRIVE[] macro

Well, it is high time to use our macro and if you’ve set everything correctly the process would be smooth and convenient. Go back to your Outlook > New Email, open the Shared Email Templates pane and start with a new template:

  1. Click the Insert macro button, find and select the ~%ATTACH_FROM_ONEDRIVE[] macro from the drop-down list:
    Choose the macro to attach a file from OneDrive

    Tip. Straight on the add-in will ask to log in to your OneDrive account to access your files and folders. This step is a normal behavior and must not be ignored.

  2. Navigate to the file you need to attach and press Select:
     Select the necessary file in your OneDrive

    When you select this macro, the add-in builds a unique path and displays it in square brackets []. Please do not modify or manually change this link, the macro won’t work at all. :) I know, the result looks awkward, but please keep it as is:
    An email template with an inserted macro to attach a file

  3. Hit Save and use this template as many times as you like:
    Save template with an inserted macro

    The macro will do the job for you and attach the file without extra manual effort from your side.

Transparent warnings

You might get this message when creating or editing a template:
Warning that the file is not shared

Don’t trouble about it, this reminds you to be nice and share the file you intend to attach, otherwise your teammates will get the below error:
An error that the file can’t be pasted as it is not found

I tried my best to be simple and precise in this article to walk you through the process. See you in my next post about attaching files from SharePoint. And, dear all, your comments or questions would be much appreciated.

Table of contents

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)