Microsoft Office Word 2016邮件合并自定义无效配方的问候语 [英] Microsoft Office Word 2016 mail merge custom invalid recipement for greeting line

查看:183
本文介绍了Microsoft Office Word 2016邮件合并自定义无效配方的问候语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一封电子邮件列表,其中一些用于公司名称,另一些具有名字的姓氏.如果我包括"hello first_name last_name"的问候语行,则可以,但是如果没有名字,我希望它说"hello company_name".有办法吗?

I have a list of emails and some are for company names and others have first name last name. If I include the greetings line for "hello first_name last_name" it works but I want it to say "hello company_name" if there is no first name. Is there a way to do this?

推荐答案

要将此逻辑放入您的邮件合并中,我建议放弃问候语,而是将合并域代码嵌套在单词中,否则,否则语句.域代码是看不见的标记和逻辑,Word会在需要时将其替换为文本.

To place this logic into your mail merge I suggest forgoing the Greeting Line and instead nesting Merge Field Codes inside a Word If, Then, Else statement. Field Codes are invisible markers and logic that Word replaces with text when needed.

重要说明:请勿将以下代码复制并粘贴到您的邮件合并主文档中.通过在Word文档中键入CTRL-F9来生成代码中的花括号{ }.以这种方式生成这些大括号告诉Word这将是一个域代码.因此,您将需要使用CTRL-F9键入以下代码,以便在需要时生成这些花括号.

Important Note: Do not copy and paste the below code into your mail merge main document. The curly braces { } in the code are generated by typing CTRL-F9 in your Word document. Generating these braces in this manner tells Word that this will be a Field Code. As such you will need to type the below code using CTRL-F9 to generate these braces when needed.

重要说明2:域代码是不可见的,除非将文档切换为显示它们. ALT-F9将切换您的文档以隐藏域代码(以便您可以测试合并)或显示它们(以便您可以编辑代码).

Important Note 2: Field Codes are invisible unless the document is toggled to display them. ALT-F9 will toggle your document to hide field codes (so you can test the merge) or display them (so you can edit the code).

Word的IF语句本身位于域代码括号内,语法为.如果test为true,则为true,否则为false . Word使用空格分隔测试部分,正确部分和错误部分.它还要求将正确和错误的结果用引号引起来.所有域代码都用大括号(CTRL-F9)括起来.

Word's IF statement, which is itself placed within Field Code braces, has the syntax If test is true, then true, else false. Word uses spaces to separate the test, true, and false sections. It also requires that the true and false outcomes are enclosed in quotation marks. All Field Codes are enclosed in curly braces (CTRL-F9).

将以下代码放在开头文本(例如,"Dear")和结尾标点(逗号或冒号)之间.

Place the following code between the opening text (for example, "Dear") and closing punctuation (comma or colon).

{ IF { MERGEFIELD Last_Name } = "" "{ MERGEFIELD Company_Name }" "{ MERGEFIELD First_Name } { MERGEFIELD Last_Name }"}

这篇关于Microsoft Office Word 2016邮件合并自定义无效配方的问候语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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