在 Word 2013 的邮件合并中添加变量超链接 [英] Add Variable Hyperlink in Mail Merge in Word 2013
问题描述
我正在尝试向邮件合并字段添加超链接.所以是这样的:
I'm trying to add a hyperlink to a mail merge field. So something like this:
{HYPERLINK "{MERGEFIELD "Links" }"}
所以我创建了一个这样的字段.
So I create a field like this.
{ MERGEFIELD Links }
以上工作(它为不同的收件人显示不同的链接).
And the above works (it displays different links for different recipients).
但是,当我转到编辑字段",然后尝试将 HYPERLINK 添加到 { MERGEFIELD Links} 时,Word 将不允许我这样做.这意味着当我输入 HYPERLINK 后跟一个空格时,变量"字段消失了.而不是文字显示...
However, when I go to Edit Field, and then attempt to add HYPERLINK to { MERGEFIELD Links}, Word will not allow me. Meaning that when I type HYPERLINK followed by a space, the "variable" field is gone. Instead of word displaying...
链接
它显示...
{HYPERLINK "{MERGEFIELD "Links" }"}
即使在我按下更新字段"之后.所以 Word 出于某种原因不允许我进入超链接.
even after I press "update field". So Word is not letting me enter HYPERLINK for some reason.
我该如何解决这个问题?
How do I solve this?
推荐答案
来自 Microsoft 网站,
- 在
Insert
菜单上,单击Field
(在更高版本的 Office 版本中的 Quick Parts 下). - 在字段名称列表中,单击超链接,然后单击确定.文本 <代码>错误!超链接引用无效出现在文档中.
- 按
ALT+F9
打开{ HYPERLINK * MERGEFORMAT }
域代码. - 将插入点放在
HYPERLINK
之后,然后添加一个空格. - 在插入菜单上,单击
Field
.在Field names
列表中,单击MergeField
.在字段名称文本框中,键入包含超链接的数据源字段的名称,然后单击确定.例如,如果数据源字段的名称为Address1",则字段代码如下所示:{ HYPERLINK { MERGEFIELD "Address1" } * MERGEFORMAT }
- 按 ALT+F9 关闭域代码.你现在有
错误!超链接引用无效
文本. - 将插入点放在
错误中间的任意位置!超链接引用无效
文本,并插入要显示的文本.如果您需要合并字段,请从菜单上的插入合并字段"选项中插入该字段. - 删除
Error!
...在您要保留的文本前后的剩余文本.
- On the
Insert
menu, clickField
(under Quick Parts in later office versions). - In the Field names list, click Hyperlink,
and then click OK. The text
Error! Hyperlink reference not valid
appears in the document. - Press
ALT+F9
to open the{ HYPERLINK * MERGEFORMAT }
field code. - Put the insertion point after
HYPERLINK
and then add a space. - On the Insert menu, click
Field
. In theField names
list, clickMergeField
. In the Field name text box, type the name of the data source field that contains the hyperlink, and then click OK. For example, if the name of the data source field is "Address1," the field code appears as follows:{ HYPERLINK { MERGEFIELD "Address1" } * MERGEFORMAT }
- Press ALT+F9 to close the field code. You now have
Error! Hyperlink reference not valid
text. - Put the insertion point at some arbitrary place in the middle of the
Error! Hyperlink reference not valid
text, and insert the text you want to appear. If you would like a merge field, insert that from the "Insert Merge Field" option on the menu. - Delete the remaining text of
Error!
... before and after the text you want to keep.
注意:如果您的合并字段只包含一个标识符,并且 URL 作为合并文档的静态部分提供,这也可以工作.在第 5 步中,您需要插入 URL 文本以及 MergeField,例如:{ HYPERLINK "https://www.myurl.com/EditForm.aspx?ID={ MERGEFIELD ID }" * MERGEFORMAT }
Note: If your merge field only contains an identifier, with the URL to be provided as a static part of the merge document, this can work also. On Step 5, you will need to insert the URL text as well as the MergeField, for example:
{ HYPERLINK "https://www.myurl.com/EditForm.aspx?ID={ MERGEFIELD ID }" * MERGEFORMAT }
这篇关于在 Word 2013 的邮件合并中添加变量超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!