How to use macros in your templates

In Shared Email Templates for Outlook

Macros are a handy feature that lets you avoid performing repetitive actions. For example, macros allow creating templates with attachments, so that each time you write a certain kind of message, you don't have to remember to add a particular file. You can fill in the Bcc, Cc, Subject email fields and add information to the message body.

On this page, find the list of available macros and instructions on how to use them. You can also refer to the Сomplete list of macros page to get a list of all macros and their descriptions.

Note. Please note, the tool supports a maximum of one nested level of macros. For instance, you can put a macro into another macro, e.g. ~%MACRO[~%MACRO], and this will work fine. But if you add a second nested level, e.g. ~%MACRO[~%MACRO[~%MACRO]], we cannot guarantee the correct functioning of the tool.

Video: How to use macros in Shared Email Templates

How to add macro to your template

To add a macro, take the following steps:

  1. Open an existing template or create a new one and click Edit:
    Edit template.
  2. In the text of the template, place the cursor where you want to put a macro, click the Insert Macro icon, and select the macro you want to use.

    For example, we select the ~%INSERT_RECIPIENT_FIRSTNAME macro that inserts the first name of the recipient:
    Select your macro.

    Now recipient's name will be pasted automatically each time we use this template:
    Template with macro.

  3. Click the Save button.
Tip. In My templates you will find the Templates with macros folder. There is a list of macros, and when you click on a macro you can see its description and instruction on how to use it:
The list of macros.

The list of macros and what they do

Find the activity you'd like to implement and the corresponding macro you can use. You can automatically fill in the To, CC, BCC, and Subject fields, as well as add information to the message body or get sender's or recipient's info pasted into your email.

If this is your first acquaintance with macros, we recommend that you read this section carefully and try out all the macros yourself to discover how they can simplify your emailing routine.

Tip. You can use nested macros as long as they do not exceed one nested level.
For example, feel free to create such macros as ~%FILLSUBJECT[~%DATE], ~%WHAT_TO_ENTER[~%INSERT_RECIPIENT_FIRSTNAME;~%TO], ~%ADDSUBJECT[Dear ~%INSERT_RECIPIENT_FULLNAME], etc.
Note. Please keep in mind that the entire macro text has to be of the same formatting, otherwise, the macro won't work. So, if your macro may have different formatting, select the entire macro text and clear formatting by clicking the Clear Formatting icon in the toolbar:

Fill in email fields: To, Cc, Bcc, Subject

Note. With all macros in this group, it doesn't matter where in the text of a template you insert a macro. These macros put the needed information into the email fields, you won't see them in the message body.
  • The ~%FILLTO[], ~%FILLCC[], ~%FILLBCC[] macros insert the specified email addresses (separated by semicolons) into the To, Cc, Bcc, fields accordingly. Any previously added addresses will be deleted.
  • The ~%FILLSUBJECT[] macro inserts the specified text into the Subject field. Any previously added text in the Subject field will be deleted.
  • The ~%ADDTO[], ~%ADDCC[], ~%ADDBCC[] macros add the specified email addresses (separated by semicolons) to the To, Cc, Bcc fields accordingly. All the previously added addresses will be kept.
  • The ~%ADDSUBJECT[] macro adds the item to the Subject field. The previously added to the Subject field text will be kept.

    Tip. When you use ~%ADDSUBJECT[], the utility doesn't add any separators or spaces between the inserted text units in the Subject field, so bear in mind to add a space or separator yourself.
  • To use the macro, insert it into your template and replace "example@domain.com" with the necessary email address, in case of ~%FILLSUBJECT[] / ~%ADDSUBJECT[] replace "Text" with the necessary text.

    Examples of use:
    ~%FILLTO[example@domain.com]
    ~%FILLCC[example@domain.com]
    ~%FILLBCC[example@domain.com]
    ~%FILLSUBJECT[Text]

    ~%ADDTO[example@domain.com]
    ~%ADDCC[example@domain.com]
    ~%ADDBCC[example@domain.com]
    ~%ADDSUBJECT[Text]

Known issue. Please note that email addresses and text you insert must be of the same formatting as the text of the macro. If you copy an email address or text from some other resources or a web page, they will be pasted into a template in their original formatting, and the macro won't work. So, we recommend that you type in the needed text manually to avoid formatting problems.

Video: How create templates with attached files

Attach files from URL or OneDrive

  • ~%ATTACH_FROM_URL[] attaches a file from the URL you specify. In the macro inserted into your template, replace "https://domain.com/file-url" with a link to the required file.
    Example: ~%ATTACH_FROM_URL[https://domain.com/file-url]

    Note. If you use the %ATTACH_FROM_URL[] macro in a template that is located in a team and shared with other users, make sure that your teammates have access to the URL you indicate in the macro.
  • ~%ATTACH_FROM_ONEDRIVE[] attaches a file from your OneDrive. When you pick this macro, the add-in will ask to log in to your OneDrive account and choose a file to attach:
    Select a file to attach from OneDrive.

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

Insert image from OneDrive

  • ~%INSERT_PICTURE_FROM_ONEDRIVE[] inserts a picture from your OneDrive. When you pick this macro, the add-in will ask to log in to your OneDrive account and choose a picture to insert into your email:
    Select a picture to insert from OneDrive.

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

    You'll see the Image size window:
    Resize your image.

    If required, you can set the size of an image (in pixels) and click Insert.

    Note. If you use %ATTACH_FROM_ONEDRIVE[] or ~%INSERT_PICTURE_FROM_ONEDRIVE[] 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 OneDrive. You can learn more about managing access in OneDrive on the Share OneDrive files and folders page.
    Tip. For your convenience, 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.
    Known issue. When you insert a template with ~%ATTACH_FROM_ONEDRIVE[] or ~%INSERT_PICTURE_FROM_ONEDRIVE[] macros, you'll have to sign in to your OneDrive account even if you are already signed in to the OneDrive app. This irritating situation happens because Microsoft guys still have not implemented the Single Sign-on feature for add-ins. Hopefully, this is a temporary problem and sooner or later Single Sign-on will be implemented.

Insert picture from URL

  • ~%INSERT_PICTURE_FROM_URL[] attaches and displays an image from the URL you indicate. When you select the macro, a dialog window will open. Enter your URL, set a size of a picture if you want, and click Insert:
    Resize your image.
    If you do not enter any size, the image will be inserted in its original dimensions.

    When you use a template with this macro, the macro downloads the chosen image, inserts a hidden attachment and displays it in the message body.

    Note. If you use the ~%INSERT_PICTURE_FROM_URL[] 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.
    Tip. You can find more ways to insert an image into your templates on the How to insert pictures into your templates page.

Add information to message body

Note. As these macros add information to the message body, make sure to put the cursor right to the place of a template where you want to see this information.
  • The ~%SUBJECT, ~%DATE, ~%TIME macros insert the contents of the Subject field or the current date and current time into the message.

    Examples of use:
    If you have any questions regarding ~%SUBJECT, please let me know.
    This message is composed and sent on ~%DATE.
    This message is composed at ~%TIME.

  • The ~%WHAT_TO_ENTER[] macro prompts you to enter some text every time you insert a template into a message. You can type the text directly in the box or select from the drop-down list that is created from the items you enter.

    In the macro inserted into your template, do one of the following:

    • Replace "field label" with the necessary label. This label will be displayed in the box, but you'll manage to change it if needed. For instance, the ~%WHAT_TO_ENTER[My label] macro will look like this:
      Click OK or change the item.
    • Replace "field label" with semicolon-separated items, e.g. ~%WHAT_TO_ENTER[Item 1; Item 2; Item 3]. These items will appear in the drop-down list. In this case, when you click to insert a template into your email, you'll be asked to select an item from the list:
      Select from drop-down list.
    • Delete "field label". This will display an empty box and you'll have to type in the required text.

    Example of use:
    Please let me know if you have any questions about ~%WHAT_TO_ENTER[product name].

    Note. If you insert several ~%WHAT_TO_ENTER[] macros, you will have to fill in several boxes while pasting the template — a box per each macro.
  • The ~%TO, ~%CC, ~%BCC macros insert the contents of the To, Cc, or Bcc fields accordingly into the message.

    Examples of use:
    The information contained in this message is intended only for ~%TO.
    Please note, the copy of this message is sent to ~%CC.
    Please note, the copy of this message is sent to ~%BCC.

  • The ~%INSERT_RECIPIENT_FIRSTNAME, ~%INSERT_RECIPIENT_FULLNAME, ~%INSERT_RECIPIENT_LASTNAME macros insert the first, full, or last name of the recipient into a message if the name is displayed in the To field. Otherwise, the email address is inserted.

    Examples of use:
    Hi ~%INSERT_RECIPIENT_FIRSTNAME
    Dear ~%INSERT_RECIPIENT_FULLNAME
    Dear Mr. ~%INSERT_RECIPIENT_LASTNAME

Paste profile and team properties

Please refer to the How to use team & profile properties guide.

Сomplete list of macros

You can find the full list of all Shared Email Templates macros on the Complete list of macros page.

Ask a question (posted publicly)

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.
Privacy policy Terms of use Contact us

Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.