How to use macros in templates

In Shared Email Templates for Outlook

Macros let you not only avoid performing repetitive actions but also add dynamic content, drop-down lists and fillable fields to templates. 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, add information to the message body, and a lot more.

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

Note. Please note, the add-in supports a maximum of one nested level of macros. For instance, you can put a macro into another macro, e.g. ~%Macro1[~%Macro2] , and this will work fine. But if you add a second nested level, e.g. ~%Macro1[~%Macro2[~%Macro3]], the tool will not work.

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

Download cheat sheet

How to add macro to your template

To add a macro, take the following steps:

  1. Select 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 and click the Insert Macro icon:
    Insert Macro.

    Into the Search box, type any words to look for the macro. Double-click the macro you need or select it and click Select:
    Select your macro.

    The macro is inserted and now recipient's name will be pasted automatically each time we use this template:
    Template with macro.

What macros do and how to use them

Find the activity you'd like to implement and the corresponding macro you can use. 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], ~%WhatToEnter[~%InsertRecipientFirstName;~%To], ~%AddSubject[Dear ~%InsertRecipientFullName], etc.
Note. Please keep in mind that the entire macro text has to be of consistent formatting, otherwise, the macro won't work:

If your macro may have inconsistent formatting, select the entire macro text and click 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.
Tip. By default, the name of the template is pasted to the Subject field of the email. If you do not want this to happen, use the ~%FillSubject or ~%AddSubject macro without any text in the square brackets: ~%FillSubject[] or ~%AddSubject[].
  • 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. By default, the macro adds text to the end of your Subject, so if you already have "Subject 1" in your Subject field and use ~%AddSubject[Subject 2], you'll get "Subject 1Subject 2".

    However, if you want the text to be added to the beginning of your Subject, you can use the ";{before}" element after your text in square brackets: ~%AddSubject[your text;{before}]

    So, to get "Subject 2Subject 1" in your Subject field, use the macro as follows: ~%AddSubject[Subject 2;{before}].

    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, text, and the macro must be of consistent formatting. 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.

How to attach files to emails with macros

  • To attach files, you can use the ~%AttachFromOneDrive, ~%AttachFromSharepoint, ~%AttachFromURL, and ~%WhatToAttach macros. Please see the detailed guide on the How to attach files to your templates page.

How to insert images into message body with macros

  • To insert images, you can use the ~%InsertPictureFromOneDrive, ~%InsertPictureFromURL, ~%InsertPictureFromSharePoint macros. Please see the detailed guide on the How to insert pictures into your templates page.

How to add information to message body

Add subject, date, time

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

Add addresses from To, Cc, Bcc fields

  • The ~%To, ~%Cc, ~%Bcc macros insert the content 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.

Insert recipient and sender names

Note. These macros may not work in some cases because of Outlook bugs.
  • The ~%InsertRecipientFirstName, ~%InsertRecipientFullName, ~%InsertRecipientLastName 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 ~%InsertRecipientFirstName
    Dear ~%InsertRecipientFullName
    Dear Mr. ~%InsertRecipientLastName

  • The ~%InsertSenderFirstName, ~%InsertSenderFullName, ~%InsertSenderLastName macros insert the first, full, or last name of the sender into a message.

    Examples of use:
    Warm regards, ~%InsertSenderFirstName
    Sincerely, ~%InsertSenderFullName
    Best wishes, ~%InsertSenderLastName

Paste profile and team properties

Add value from dataset

Enter text or pick date with ~%WhatToEnter macro

Clear message body & check account

  • The ~%ClearBody macro clears the message body when you insert a template into your message. So, if you may have some unneeded text in your message body, use this macro in your templates.
  • Pick ~%FromAccount if you use shared mailboxes and want to make sure your messages are sent from the correct accounts. Into the square brackets, enter an Outlook account from which the email should be sent, e.g. ~%FromAccount[user@company.com]. While template inserting, the macro will check if the account in the From field is the same as the account you entered. If they differ, the template won't be pasted.

Add inner note to template

  • You can use the ~%Note macro to leave an inner note in a template for you or your teammates. The macro does nothing to your message when you use a template that contains it, the macro is present only in the template. To use it, enter your note into the square brackets.

    Examples of use:
    ~%Note[Only for corporate customers]
    ~%Note[Contracts before 01.01.2020]

    In the preview mode, when you stand on the template, notes look like this:
    Closed note in the preview.

    To see the text of notes, simply click on them:
    Opened note in the preview.

Create meetings and appointments in Outlook Calendar

You can create appointments and schedule meetings with the help of templates and use the ~%FillLocation, ~%AddLocation, ~%Location, ~%FillSubject, ~%AddSubject, ~%AddTo, ~%FillTo, ~%AddCc, ~%FillCc macros to fill in some fields.

See the detailed manual on the Use Shared Email Templates in Outlook Calendar page.

Add merge fields

To personalize templates for mail merge campaigns, use the ~%MergeField macro. Here is the manual: Personalize mail merge template

–°omplete list of macros

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