MS Word,具有基于合并字段的查询条件的导入表 [英] MS Word, Import Table with Query Condition Based on Merge Field

查看:78
本文介绍了MS Word,具有基于合并字段的查询条件的导入表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的组织创建法规遵从邮件,该邮件将包含用于标识办公室位置,医师和SiteId的合并字段.该邮件还将包括一个信息表,该信息表取决于特定的SiteId.

I'm creating a compliance mailing for my organization, the mailing will include merge fields that identify the office location, physician, and SiteId. The mailing will also include a table of information that is dependent upon the particular SiteId.

我想使用MS Word的导入表功能,并建立一个引用合并字段(SiteId)的查询,以便插入的表填充特定站点的适当数据.我无法做到这一点.

I'd like to use the import table function of MS word and set up a query that references a merged field (SiteId) so that the inserted tables populate the appropriate data for the particular site. I'm unable to do this.

如何设置此文档,以便仅从源(ms访问查询)中导入与SiteId合并字段匹配的记录?

How can I set up this document so that I can import only records from my source (an ms access query) that match the SiteId merge field?

推荐答案

Word的邮件合并不支持一对多关系.有多种方法可以强制执行此操作,但结果只有一种方法可以生成一张表,并且由于Microsoft对其维护的重要性不足够,多年来,它变得越来越不可靠...

Word's mail merge does not support one-to-many relationships. There are ways to coerce it, but only one of them can yield a table as a result and over the years it has become less and less reliable as Microsoft has not regarded it as important enough to maintain...

您需要做的是设置一个查询,该查询仅提供要在表中显示的信息以及键(SiteId).最好对它进行排序,以便所有SiteId条目一起列出,并按照邮件合并数据源中数据通过的顺序排列.

What you need to do is set up a query that provides ONLY the information you want displayed in the table, plus the key (SiteId). It's best to sort it so that all the SiteId entries list together, and are in the order the data will come through in the mail merge data source.

在插入"选项卡上,转到文本/快速零件/插入字段",然后从对话框的列表中选择数据库"字段.单击插入数据库",然后按照对话框中的说明链接数据.确保将查询选项"设置为根据数据源中的第一个SiteId进行过滤.当您插入数据"时,请确保选择作为字段插入"选项.

On the Insert tab go to Text/Quick Parts/Insert Field and select the Database field from the list in the dialog box. Click "Insert Database" and follow the instructions in the dialog box to link in the data. Be sure to set the Query Options to filter on the first SiteId from the data source. When you "Insert Data" make sure to choose the option to "Insert as a field".

这将在文档中插入一个DATABASE字段,您可以通过切换字段代码(Alt + F9)来查看.可以编辑域代码,而您需要做的是用与之对应的MergeField替换为查询输入的文字SiteId值.

This inserts a DATABASE field in the document which you can see by toggling field codes (Alt+F9). The field code can be edited and what you need to do is substitute the literal SiteId value you entered for the query with its corresponding MergeField.

当执行到新文档的合并时,应该为与该记录的SiteId对应的每个数据记录生成一个表.但是,正如我说的那样,微软在保持这一点上做得并不出色,因此可能需要进行大量的调整和试验.

When you execute the merge to a new document that should generate a table for each data record corresponding to the SiteId for the record. But, as I said, Microsoft hasn't done a great job of maintaining this, so it may require quite a bit of tweaking and experimenting.

如果结果不令人满意,则应放弃邮件合并的想法,并使用自动化代码生成并填充文档.

If the results are not satisfactory then you should give up the idea of mail merge and use automation code to generate and populate the documents.

您可以在 http://上找到有关此主题的更多(尽管有些过时)信息. homepage.swissonline.ch/cindymeister/mergfaq1.htm

这篇关于MS Word,具有基于合并字段的查询条件的导入表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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