mail merge插件
Microsoft Word’s mail merge is an excellent productivity tool. Knowing how to create personalized subject lines and attachments that Word’s mail merge basic feature doesn’t support can be a life saver when you have to write emails in bulk.
Microsoft Word的邮件合并是一种出色的生产力工具。 当您必须批量编写电子邮件时,知道如何创建Word的邮件合并基本功能不支持的个性化主题行和附件可以节省很多时间。
In today’s article, you’ll learn how to use Word’s 2010 Mail Merge Wizard, write personalized email subjects, and setup different attachments for each of your email recipient.
在今天的文章中,您将学习如何使用Word的2010年邮件合并向导,编写个性化的电子邮件主题以及为每个电子邮件收件人设置不同的附件。
Image by M!R
图片由M!R
创建通讯组列表 (Creating a Distribution List)
Word’s Mail Merge saves us from the tedious task of entering each recipient’s email address manually by allowing us to import email addresses from Outlook contacts, Excel or Access data sources, or Word data files.
通过允许我们从Outlook联系人,Excel或Access数据源或Word数据文件导入电子邮件地址,Word的邮件合并使我们免于手动输入每个收件人电子邮件地址的繁琐任务。
Outlook’s contact is the best option among the three, and if you have not used it, now will be a good time to update your Outlook address book, and we’ll show you how to do so. You can skip the next section and start writing your mail merge, if you already know how to setup Outlook contact, otherwise the next two sections will give you some basics on how to setup your Outlook contact by importing your web based contact list.
Outlook的联系方式是三者中最好的选择,如果您还没有使用过它,那么现在将是更新Outlook通讯簿的好时机,我们将向您展示如何进行。 如果您已经知道如何设置Outlook联系人,则可以跳过下一部分并开始编写邮件合并 ,否则,接下来的两部分将为您提供有关如何通过导入基于Web的联系人列表来设置Outlook联系人的一些基础知识。
设置您的邮件资料 (Setup Your Mail Profile)
Setting up Outlook contact begins with creating a mail profile that stores your account’s email address, password, server information and links to other data such as email messages and addresses.
设置Outlook联系人首先要创建一个邮件配置文件,该配置文件存储您帐户的电子邮件地址,密码,服务器信息以及指向其他数据(如电子邮件和地址)的链接。
You can create some profiles, each tailored to specific email account.
您可以创建一些配置文件,每个配置文件都针对特定的电子邮件帐户。
A proper profile name lets you identify the email account that you associate with your mail profile.
适当的配置文件名称可让您识别与邮件配置文件关联的电子邮件帐户。
You have the option to configure your mail profile using the email address that you received from your ISP, or your own email account by selecting the third option.
通过选择第三个选项,您可以选择使用从ISP接收到的电子邮件地址或您自己的电子邮件帐户来配置邮件配置文件。
Select “Internet E-mail” to use an email provider that gives a POP service – for example, GMail.
选择“ Internet电子邮件”以使用提供POP服务的电子邮件提供程序,例如GMail。
Each Internet email provider has different POP configuration, make sure to read their user manual to learn their POP setup.
每个Internet电子邮件提供商都有不同的POP配置,请确保阅读其用户手册以了解其POP设置。
Congratulations! If you see this screen, you have setup your mail profile successfully. Now, we are ready to setup our Outlook’s contact folder.
恭喜你! 如果看到此屏幕,则说明您已成功设置邮件配置文件。 现在,我们准备设置Outlook的联系人文件夹。
填充您的联系人文件夹 (Populating Your Contact Folder)
You can enter your distribution list manually into Outlook, or import other web based address books – such as GMail, Yahoo, or Hotmail address book. Most web based email providers allow us to export our their address book into an Outlook-compatible data source. For example, Gmail gives us the option to export our contacts into an Outlook-compatible CSV file.
您可以在Outlook中手动输入通讯组列表,或导入其他基于Web的通讯录,例如GMail,Yahoo或Hotmail通讯录。 大多数基于Web的电子邮件提供商都允许我们将其地址簿导出到与Outlook兼容的数据源中。 例如,Gmail使我们可以选择将联系人导出到与Outlook兼容的CSV文件中。
Outlook import function supports a variety of file type: csv, vcard, RSS, iCalendar, and many more, making it a great tool to create your mail merge distribution list.
Outlook导入功能支持多种文件类型:csv,vcard,RSS,iCalendar等,使它成为创建邮件合并通讯组列表的理想工具。
The CSV file falls under the “Other program or file” category in Outlook.
CSV文件位于Outlook中的“其他程序或文件”类别下。
ACT file, DOS CSV, Lotus, Access 97-2003, PST files, are some of the program files that Outlook supports – for us, we chose Comma Separated Values (Windows) file type.
ACT文件,DOS CSV,Lotus,Access 97-2003,PST文件是Outlook支持的一些程序文件-对于我们来说,我们选择了逗号分隔值(Windows)文件类型。
Now, locate the CSV file that we just exported from Gmail address book.
现在,找到我们刚从Gmail通讯录中导出的CSV文件。
Out of all these folders, the contact folder is the best option for our mail merge purpose.
在所有这些文件夹中,联系人文件夹是我们合并邮件的最佳选择。
Outlook needs a few minutes to import your contact depending on the number of email addresses that you are importing.
Outlook需要几分钟来导入您的联系人,具体取决于您要导入的电子邮件地址的数量。
We should be able to use this contact folder, once Outlook has finished importing all your contacts, for the mail merge.
Outlook完成导入所有联系人后,我们应该能够使用此联系人文件夹进行邮件合并。
邮件合并向导 (Mail Merge Wizard)
Start with a blank document and open the “Mailings” ribbon to begin our mail merge.
从空白文档开始,然后打开“邮件”功能区以开始我们的邮件合并。
The wizard is the best way for beginners to get started on their first mail merge exercise.
该向导是初学者开始其第一次邮件合并练习的最佳方法。
选择邮件收件人 (Selecting Message Recipients)
The wizard will ask us to choose the document type for our mail merge, E-mail messages is the appropriate document type for today’s mail merge exercise.
向导将要求我们为邮件合并选择文档类型,电子邮件是当今邮件合并练习的合适文档类型。
We can start writing our email message from a blank document, a template, or an existing document.
我们可以从空白文档,模板或现有文档开始编写电子邮件。
Choose our Outlook contact folder as our mail merge distribution list in step 3.
在步骤3中,选择我们的Outlook联系人文件夹作为我们的邮件合并分发列表。
We have the option to use any of the mail profile that we setup in our system.
我们可以选择使用我们在系统中设置的任何邮件配置文件。
Your contact count should be more than zero if Outlook imported your Gmail address successfully.
如果Outlook成功导入了您的Gmail地址,则您的联系计数应大于零。
Choose the people that you want to include in your email distribution by ticking the appropriate check boxes.
勾选相应的复选框,选择要包括在电子邮件分发中的人员。
撰写电子邮件 (Composing the Email Message)
Start writing your email message and insert merge fields where you want to place personalized messages – such as title or last name in the appropriate place on your document.
开始编写电子邮件,并在要放置个性化消息的位置插入合并字段,例如标题或姓氏在文档的适当位置。
Each merge field will be enclosed inside a double chevron; they will be substituted with your contact card information when you complete the mail merge wizard.
每个合并字段都将包含在一个双V形内部; 完成邮件合并向导后,它们将替换为您的联系卡信息。
Preview your email message to see how Word processes the merge fields by clicking on the “Next: Preview your e-mail messages” link.
单击“下一步:预览您的电子邮件”链接,预览您的电子邮件以查看Word如何处理合并字段。
If you are happy with the preview, click the “Next:complete the merge” link, and Word will send the merged email to all your recipients with a common subject line.
如果您对预览感到满意,请单击“下一步:完成合并”链接,Word会将合并后的电子邮件发送给具有相同主题行的所有收件人。
个性化您的主题行 (Personalizing Your Subject Line)
The wizard breaks the mail merge process into these steps: choosing the right document type and template, creating a distribution list, evaluating the mail merge preview, and sending out emails to all your recipients.
该向导将邮件合并过程分为以下步骤:选择正确的文档类型和模板,创建通讯组列表,评估邮件合并预览以及向所有收件人发送电子邮件。
At this point, you may notice two common email writing activities that the wizard does not support, writing personalized subject lines, and setting up different attachments. We have to use macro to do them in mail merge, preferably before we complete the wizard.
此时,您可能会注意到该向导不支持的两种常见的电子邮件编写活动,即编写个性化的主题行以及设置不同的附件。 我们必须使用宏在邮件合并中执行它们,最好在完成向导之前。
With your letter open, press “Alt + F11” and double click “ThisDocument” in your working Word window, to open the Macro editor.
打开您的字母后,按“ Alt + F11”,然后在工作的Word窗口中双击“ ThisDocument”,以打开宏编辑器。
Paste this macro code, written by an expert macro coder hutchinsfairy, into the blank pane and save it.
将此宏代码(由专家宏代码hutchinsfairy编写)粘贴到空白窗格中并保存。
Dim WithEvents wdapp As Application
Dim EMAIL_SUBJECT As String
Dim FIRST_RECORD As Boolean
Dim WithEvents wdapp As Application
Dim EMAIL_SUBJECT As String
Dim FIRST_RECORD As BooleanPrivate Sub Document_Open()
私人子Document_Open()
Set wdapp = Application ThisDocument.MailMerge.ShowWizard 1
设置wdapp =应用程序ThisDocument.MailMerge.ShowWizard 1
End Sub
结束子
Private Sub Document_Close()
私人子Document_Close()
Set wdapp = Nothing
设置wdapp = Nothing
End Sub
结束子
Private Sub wdapp_MailMergeBeforeRecordMerge(ByVal Doc As Document, Cancel As Boolean) Dim i As Integer
私人子wdapp_MailMergeBeforeRecordMerge(ByVal文档为文档,取消为布尔值)Dim i作为整数
With ActiveDocument.MailMerge
使用ActiveDocument.MailMerge
If FIRST_RECORD = True Then EMAIL_SUBJECT = .MailSubject FIRST_RECORD = False Else .MailSubject = EMAIL_SUBJECT End If
如果FIRST_RECORD = True,则EMAIL_SUBJECT = .MailSubject FIRST_RECORD = False,否则.MailSubject = EMAIL_SUBJECT
i = .DataSource.DataFields.Count
我= .DataSource.DataFields.Count
Do While i > 0 .MailSubject = Replace(.MailSubject, "", .DataSource.DataFields(i).Value, , , vbTextCompare) i = i - 1 Loop
当i> 0时执行.MailSubject = Replace(.MailSubject,“”,.DataSource.DataFields(i).Value,,,vbTextCompare)i = i-1循环
End With
结束于
End Sub
结束子
Private Sub wdapp_MailMergeBeforeMerge(ByVal Doc As Document, ByVal StartRecord As Long, ByVal EndRecord As Long, Cancel As Boolean)
私人子wdapp_MailMergeBeforeMerge(ByVal文档为文档,ByVal StartRecord为长,ByVal EndRecord为长,布尔值取消)
FIRST_RECORD = True
FIRST_RECORD = True
End Sub
结束子
Private Sub wdapp_MailMergeAfterMerge(ByVal Doc As Document, ByVal DocResult As Document)
私人Sub wdapp_MailMergeAfterMerge(ByVal文件为文档,ByVal文件结果为文档)
ActiveDocument.MailMerge.MailSubject = EMAIL_SUBJECT
ActiveDocument.MailMerge.MailSubject = EMAIL_SUBJECT
End Sub
结束子
Go back to your document and click on the “Next: complete the merge” link to send out your email.
返回您的文档,然后单击“下一步:完成合并”链接以发送电子邮件。
Click on the “Electronic Mail…” link to send out your message.
单击“电子邮件…”链接以发送您的消息。
Place the appropriate merge fields, surrounded with a chevron, into the subject line.
将适当的合并字段(用人字形包围)放入主题行。
The macro will parse the merge field and replace it with the recipient’s last name when Word email the document.
当Word通过电子邮件发送文档时,宏将解析合并字段并将其替换为收件人的姓氏。
将不同的项目附加到您的电子邮件 (Attaching Different Items to Your E-Mail)
Up to this point, we have learned how to use the mail merge wizard and how to personalize the subject fields – and to complete today’s tutorial, we’ll show you a third party add-in that enable us to attach different file for each email.
到目前为止,我们已经学习了如何使用邮件合并向导以及如何个性化主题字段,并且为了完成本教程,我们将向您展示第三方加载项 ,使我们能够为每封电子邮件附加不同的文件。
Download the add-in, unzip it, and you’ll find that the add-in comes as Word Document templates. Use “CreateEMailData Word 2007 Ver02”, if you are using word 2007 or 2010, and “CreateEMailData Word 2003 Ver02”, if you are using Word 2003.
下载该加载项,将其解压缩,您会发现该加载项作为Word文档模板提供。 如果使用的是Word 2007或2010,请使用“ CreateEMailData Word 2007 Ver02”;如果使用的是Word 2003,请使用“ CreateEMailData Word 2003 Ver02”。
Copy the appropriate document template into your “%appdata%\Microsoft\Word\STARTUP” folder where “%appdata%” is your Microsoft startup folder-in our case it is “C:\Users\zainul\AppData\Roaming”.
将适当的文档模板复制到您的“%appdata%\ Microsoft \ Word \ STARTUP”文件夹中,其中“%appdata%”是您的Microsoft启动文件夹-在我们的情况下为“ C:\ Users \ zainul \ AppData \ Roaming”。
Restart your Word, after you copy the file into the Microsoft startup folder, and you should see two new add-ins: Create Data File and Merge to Email, under the “Mailing” ribbon menu.
将文件复制到Microsoft启动文件夹后,重新启动Word,您应该在“邮件”功能区菜单下看到两个新的加载项:“创建数据文件”和“合并到电子邮件”。
Prepare a data file with a two-column table – the recipient email address in the left column, and the full path to your attachment file in the right column, then save it under the same folder as your email merge document as “MergeAttachmentsData”. We need to stress that you must save the file as “MergeAttachmentsData”, otherwise the add-in can’t find the file to look up for attachments.
准备一个具有两列表的数据文件-左列中的收件人电子邮件地址,右列中的附件文件的完整路径,然后将其保存为与电子邮件合并文档相同的文件夹“ MergeAttachmentsData”。 我们需要强调的是,您必须将文件另存为“ MergeAttachmentsData”,否则外接程序将找不到该文件以查找附件。
Go back to your mail merge document and split documents into individual files.
返回邮件合并文档,然后将文档拆分为单个文件。
A new word document window should appear, and click the “Merge to Email” add-in button. Simply click the ‘Ok’ button on the yellow dialog, since we already prepared the data file.
应该会出现一个新的Word文档窗口,然后单击“合并到电子邮件”加载项按钮。 因为我们已经准备好数据文件,所以只需单击黄色对话框上的“确定”按钮。
Put a proper subject for your email, click OK, and Outlook will send your email with the attachment that you specify in the data file.
为您的电子邮件输入适当的主题,单击“确定”,Outlook将发送您在数据文件中指定的附件的电子邮件。
Word, with its many useful features, is truly a great productivity tool. We look forward to write more Word articles for our readers. In the meanwhile, check out the other Words articles on our site.
Word具有许多有用的功能,确实是一个出色的生产力工具。 我们期待为读者写更多的Word文章。 同时,请查看我们网站上的其他Words文章 。
We hope that you have learned how to use Word mail merge from today’s article. Feel free to discuss other mail merge tips with the other fellow readers in the comments section.
我们希望您从今天的文章中学到了如何使用Word邮件合并。 随时在评论部分与其他读者讨论其他邮件合并技巧。
mail merge插件