目录
Step 1. Prepare your Excel table
Step 2. Generate proper content for the table
Images to insert: How to get a link that will work
Text to add: How to arrange it properly
Files to attach: How to get a link that will work
Step 3. Create a dataset from your Excel file
Step 4. Make your Outlook template dynamic
How to add an image for the current user
How to add certain text for the current user
How to add an attachment for the current user
Good to go :)
Available downloads
首页 专题 excel 如何为当前用户创建动态的Outlook电子邮件模板

如何为当前用户创建动态的Outlook电子邮件模板

Mar 27, 2025 pm 12:20 PM

On reading this blog post, you'll learn how to automatically switch images, attachments, and text in a shared Outlook template, depending on the current user.

Let's say, you have a really nice template, and your teammates would be happy to use it in their correspondence, but you're stuck on making this template dynamic. The problem is that each of your colleagues would like to get a different image, an individual attachment, and some specific text added to the template every time they use it. So, when the template is going to be pasted into the email body by another person, all this stuff should change automatically.

Do you think that such a task is too difficult? Nothing of the kind ... for our smart Shared Email Templates add-in :) Just a few steps to take, and a dynamic Outlook template for your team will be ready.

Step 1. Prepare your Excel table

First, make sure you have all the necessary variables in one and the same Excel table stored, say, in OneDrive. How would you do that? Check both the structure and the content of your table:

  1. The leftmost column of the table should contain your colleagues' email addresses. They will be sort of reference points for Shared Email Templates. Using them, the add-in will be able to find the right image, attachment, and text for each person.
  2. All the other columns are reserved for the items that will be dynamically inserted into an email. I mean pieces of text and links to files that your teammates are interested in. Be sure to create these links with the Shared Email Templates add-in as described below, otherwise they won't work the right way.

Step 2. Generate proper content for the table

At this stage, your table may be like this one:

如何为当前用户创建动态的Outlook电子邮件模板

The email addresses, which your teammates' Shared Email Templates accounts are registered to, are in column A. The email addresses in my screenshots are imaginary—just to give you an example :)

Column B ('Image'), column C ('Text'), and column D ('Attachment') are still empty and have to be filled. Let's get proper data for them.

  1. Run Shared Email Templates.
  2. Click the New Template button, and then click the Insert Macro icon.
  3. You'll see a list of all the macros the add-in has. Find and pick this one: ~%InsertPictureFromOneDrive.
  4. Select a file that contains one of the images you would like to swap.

    Note. Don't forget to share these files beforehand. Otherwise, your colleagues won't have access to them.

  5. Fill in the boxes of the Insert picture dialog window (the way you need) and click Insert.
  6. Find the View HTML and View Template Content icons on the editor toolbar. They are neighbors :) Click any of them:

    如何为当前用户创建动态的Outlook电子邮件模板

  7. Select and copy the ~%InsertPictureFromOneDrive macro along with the link created:

    如何为当前用户创建动态的Outlook电子邮件模板

  8. Paste the copied line into your Excel table.

    Note. Make sure that the email address of your teammate who the image is intended for is in the same row:

    如何为当前用户创建动态的Outlook电子邮件模板

  9. Get links to other images in the same way and paste them in the corresponding rows:

    如何为当前用户创建动态的Outlook电子邮件模板

Text to add: How to arrange it properly

Now, it's time to deal with text.

If you're happy with plain text that has no formatting at all, simply type the required extracts one by one in an individual cell each (on the right of the corresponding email address, of course). The add-in will bring this text to your template as is.

Would you rather get some phrases bold, colored, or printed in italics? If so, format them with standard HTML tags or let the add-in do that for you. Here's how:

  1. Create a new template by clicking the New Template button.
  2. Type the text that any of your colleagues needs and format it with icons on the editor toolbar:

    如何为当前用户创建动态的Outlook电子邮件模板

  3. When you're done, click the View HTML icon to copy the lines you'll see in the View HTML window:

    如何为当前用户创建动态的Outlook电子邮件模板

    Tip. You can also copy these lines from View Template Content.

  4. Insert the lines into your Excel table. Don't forget that they should be in the same row as the email address of the person who is interested in using this text:

    如何为当前用户创建动态的Outlook电子邮件模板

    Tip. If there are line breaks in your text, select the cell of interest, and paste the text directly into the formula bar to avoid splitting.

  5. Fill the rest of the column likewise:

    如何为当前用户创建动态的Outlook电子邮件模板

As for the files that should be attached, process them with the ~%AttachFromOneDrive macro:

  1. Run Shared Email Templates and click New Template.
  2. Go to the editor toolbar, click Insert Macro, and select ~%AttachFromOneDrive.
  3. Find and pick one of those shared files that your colleagues would like to attach.
  4. Click View HTML or View Template Content.
  5. Select the ~%AttachFromOneDrive macro whole—from the tilde to the closing square bracket:

    如何为当前用户创建动态的Outlook电子邮件模板

  6. Copy and paste the selected line to your Excel table:

    如何为当前用户创建动态的Outlook电子邮件模板

  7. Do that for all the files of interest:

    如何为当前用户创建动态的Outlook电子邮件模板

Step 3. Create a dataset from your Excel file

Convert your Excel table into a Shared Email Templates dataset. Here are the detailed instructions: Connect Excel table.

Step 4. Make your Outlook template dynamic

Finally, your dataset is ready, and all you need do is modify your template.

How to add an image for the current user

Let two macros of ours—~%DatasetValue and ~%ProfileProperty—work for you :)

  1. Find the existing template you want to make dynamic and open it in the Edit mode. (Or create a new template from scratch, if you like.)
  2. Decide where exactly the changing image will appear and place the cursor there.
  3. Click the Insert Macro icon and pick ~%DatasetValue from the list.
  4. In the macro's dialog window that you'll see, do the following:
    • Choose the necessary dataset ('NewTeam_members' in my case).
    • Pick the column containing the values to be returned (in my Excel table, it's 'Image').
    • Select any item under "Key value" to delete it and type "~%ProfileProperty[EmailAddress]" instead.

      如何为当前用户创建动态的Outlook电子邮件模板

  5. Click Insert and Save.

Congrats! :) You've just nested the ProfileProperty macro within the DatasetValue one. Would you like to know what for? :) The ProfileProperty macro will bring the current user's email address and thus 'point out' the right direction for the DatasetValue macro. In its turn, the DatasetValue macro will track down the right cell in your dataset and fetch the image of interest that the ~%InsertPictureFromOneDrive macro returns.

How to add certain text for the current user

The way of providing the current user with a specific piece of text doesn't differ substantially from getting a different image for them:

  1. Go back to editing your template to insert the ~%DatasetValue macro again.
  2. In the Dataset value dialog window, select the needed dataset, choose the column with text fragments (I'll opt for 'NewTeam_members' and 'Text'), and pick any line in the Key value drop-down menu to replace it with "~%ProfileProperty[EmailAddress]":

    如何为当前用户创建动态的Outlook电子邮件模板

  3. Insert the macro and save your template.

From now on, the macros operating in coalition will easily find the email address of the current user in the specified dataset and return the text this colleague of yours needs.

How to add an attachment for the current user

With practiced ease :) insert one more DatasetValue macro in the text of your template. This time, it is necessary for bringing an individual attachment to each user.

  1. In the Edit mode, click Insert Macro and choose ~%DatasetValue.
  2. Fill in the boxes of the macro's dialog window picking the right dataset (I'll pick 'NewTeam_members'), selecting the column with the ~%AttachFromOneDrive macros in it (I'll select 'Attachment'), and putting "~%ProfileProperty[EmailAddress]" instead of any item from the Key value list:

    如何为当前用户创建动态的Outlook电子邮件模板

  3. Click Insert and save the template.

Good to go :)

Hooray—your dynamic template is ready :) The part you've just modified may look like this:

如何为当前用户创建动态的Outlook电子邮件模板

If I'm the current user, the template pasted into the email body will include the below attachment, image, and text:

如何为当前用户创建动态的Outlook电子邮件模板

If it's my colleague Alex who is the current user, the same set of macros will bring another combination of inserted items for him:

如何为当前用户创建动态的Outlook电子邮件模板

If the current user is my colleague Kate, the inserted attachment, image, and text will be as follows:

如何为当前用户创建动态的Outlook电子邮件模板

Now you know the secret to creating dynamic Outlook email templates and can tell it to your colleagues. Or ... you can keep it and become indispensable for your team ;)

Available downloads

Why Shared Email Templates? Top 10 reasons (.pdf file)

以上是如何为当前用户创建动态的Outlook电子邮件模板的详细内容。更多信息请关注PHP中文网其他相关文章!

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

<🎜>:泡泡胶模拟器无穷大 - 如何获取和使用皇家钥匙
4 周前 By 尊渡假赌尊渡假赌尊渡假赌
北端:融合系统,解释
4 周前 By 尊渡假赌尊渡假赌尊渡假赌
Mandragora:巫婆树的耳语 - 如何解锁抓钩
3 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

热门话题

Java教程
1676
14
CakePHP 教程
1429
52
Laravel 教程
1333
25
PHP教程
1278
29
C# 教程
1257
24