使用来自1个邮件合并列表的动态模板 [英] Using dynamic templates from 1 mail merge list

查看:130
本文介绍了使用来自1个邮件合并列表的动态模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是


我很难找到解决此问题的方法。任何帮助将不胜感激。


$
我有一个"邮件合并"包含需要在不同模板中填充的信息的列表。列表的第一列包含需要使用的文档的名称(例如"Document1.docx")。我们有100多个不同的
文档模板,可能需​​要调用和填充。

Hello,

Im having difficulty coming up with a solution to this problem. Any help would be greatly appreciated.

I have a "mail merge" list with information that needs to be populated in different templates. The first column of the list contains the name of the document that needs to be used (e.g. "Document1.docx"). We have over 100 different document templates that could need to be called and populated.

我想找到一种方法来遍历列表,打开第一列中列出的文档,然后合并该行的信息并保存文档。

I would like to find a way to iterate through the list, open the document listed in the first column then merge the information just for that row and save the document.

我正在考虑编写VBA脚本来执行此操作但是我似乎无法弄清楚如何将该特定行合并到相应的文档模板中而不将每个条目合并到该文档模板中文档模板。 

I was thinking of writing a VBA script to do this but I cant seem to figure out how to merge that specific row into the respective document template without merging every entry into that document template. 

感谢任何帮助。

推荐答案

您可以使用以下行编码的INCLUDETEXT字段轻松地完成此操作:

You can do that quite easily using an INCLUDETEXT field coded along the lines of:

{INCLUDETEXT" C:\\FilePath \\ {MERGEFIELD DocName}"}

或:

{INCLUDETEXT" C:\\FilePath \\«DocName»"}

{INCLUDETEXT "C:\\FilePath\\{MERGEFIELD DocName}"}
or:
{INCLUDETEXT "C:\\FilePath\\«DocName»"}

如果名称不包含文件扩展名,请按以下方式添加:

If the name doesn't include the file extension, add it thus:

{INCLUDETEXT" C:\\FilePath \\ {MERGEFIELD DocName} .DOCX" ;}

或:

{INCLUDETEXT" C:\\FilePath \\«DocName»" .docx}

{INCLUDETEXT "C:\\FilePath\\{MERGEFIELD DocName}.docx"}
or:
{INCLUDETEXT "C:\\FilePath\\«DocName»".docx}

无需VBA。

注意:场支撑对(即'{}')上面的例子都是在文档中创建的,通过Ctrl-F9(Mac上的Cmd-F9);你不能简单地输入或复制&从这条消息中粘贴它们。通过任何标准的Word对话添加
也不实际。同样,您无法输入或复制&粘贴V形符号(即'«»') - 它们是实际合并字段的一部分,您可以从"插入合并字段"下拉列表中插入它们。现场施工中表示的空间
都是必需的。另请注意,路径分隔符需要双反斜杠(即\\不仅仅是\)。

Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practical to add them via any of the standard Word dialogues. Likewise, you can't type or copy & paste the chevrons (i.e. '« »') - they're part of the actual mergefields, which you can insert from the 'Insert Merge Field' dropdown. The spaces represented in the field construction are all required. Note also that the path separators require double backslashes (i.e. \\ not just \).


这篇关于使用来自1个邮件合并列表的动态模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆