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.

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.

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=, ~%FILLSUBJECT= macros insert the specified email address into the To, Cc, Bcc, Subject fields accordingly. Any previously added addresses and text in the Subject field will be deleted.
  • The ~%ADDTO=, ~%ADDCC=, ~%ADDBCC=, ~%ADDSUBJECT= macros add the specified email address or item to the To, Cc, Bcc, Subject fields accordingly. All the previously added addresses and text in the Subject field 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

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 teams 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_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.
  • Note. If you use %ATTACH_FROM_ONEDRIVE= or ~%INSERT_PICTURE_FROM_ONEDRIVE= in a template that is located in teams 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.

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

Learn more capabilities of Shared Email Templates:

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.