邮件合并后无法再检查CheckBox的状态 [英] State of CheckBox can no more be checked after mail merge

查看:170
本文介绍了邮件合并后无法再检查CheckBox的状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用word自动化创建了一个邮件合并.在我的模板文件中,我具有以下复选框,可通过以下代码将其设置为选中或未选中状态:

I create a mail merge with word automation. In my template file I have checkboxes which are set to checked or unchecked state through the following code:

{IF {MERGEFIELD fieldName}="y" [checked checkbox] [unchecked checkbox]}

其中[已选中的复选框]和[未选中的复选框]为Check Box Content Controls,并带有相应的选中状态.

where [checked checkbox] and [unchecked checkbox] are Check Box Content Controlswith the corresponding check-state.

到目前为止,这个方法工作正常.但是,在邮件合并的输出文档中,该复选框不再可用.看来,复选框内容控件"将被删除,并且在输出文档中将仅保留代表符号.

This works fine so far. However in the output document of the mail merge, the checkboxes are no more checkable. It seems that the Check Box Content Control will be removed and only the representing symbol will be left in the output document.

是否可以添加一个基于数据源值选中的复选框,但在合并文档中仍然是可检查/不可检查的复选框?

Is there the possibility to add a checkbox that is checked based on a value of the data source but still is checkable/uncheckable in the merged document?

我也尝试过使用旧版Forms和Active X控件,但是没有成功.

I also have tried with legacy Forms and Active X Controls, however I had no success.

推荐答案

状态
我尝试了很多事情,但很少成功/没有成功.就像我所描述的那样:在合并过程中,内容控件将通过代表符号替换,并且我没有发现更改此行为.

Status
I have tried a lot of things with few/no success. It seems as I described: Through the merging process, the Content Control will be replaced through the representating symbol and I have not found to change this behaviour.

解决方法
最后,我要做的是进行后处理操作,以通过新的内容控制"复选框替换目标文档中特定占位符的所有实例.该状态取自占位符(有两个不同的占位符,每个州占一个). 该操作的扩展版本还可以查找邮件合并操作的插入符号,但我拒绝实现此功能.

Workaround
What I have done in the end, is to make a post-process operation that replaces all instances of a specific placeholder in the destination document through a new Content Control Checkbox. The state is taken from the placeholder (there are two different placeholders, one for each state). An extended version of the operation could also look for the inserted symbols of the mail merge operation, I have disclaimed to implement this.

结论
该解决方案运行良好,最终模板的创建也更加简单.但是我觉得这很笨拙,如果有人有更好的方法,请在此处发布.

Conclusion
The solution works fine and eventually also the creation of the templates is more simple. However it feels to me very clumsy and if someone has a better approach, please post it here.

我对替换代码感兴趣,我在此处一个关于它的问题.

I someone is interested in the replacement code, I have postet here a question about (with) it.

这篇关于邮件合并后无法再检查CheckBox的状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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