有没有办法让最终用户使用 Access 中设置的当前筛选器作为 Word 邮件合并的数据源?
我们的产品之一是 Access 数据库,其中包含一个列出数千个地址的表格。我们的产品包括一个用户友好的界面,用于搜索和过滤地址。这些显示在表单上,我们将其称为 frmAddress。
我们在 frmAddress 上包含一个导出到 Excel 按钮,该按钮获取当前过滤器集并将其导出到 Excel。
要将过滤后的地址用作 Word 邮件合并的数据源,最终用户首先导出到 Excel,然后使用 Excel 文件作为数据源。
但这是一个相当漫长的过程。有没有办法直接连接到 Access 并提取地址(frmAddress 中设置的当前过滤器,而不是完整的表)?如果不能直接完成,有什么可以接近的吗?
我能想到的最接近的事情是在每次更改时将当前过滤器集保存为动态查询的 CommandText,但在我看来,在 Word 2003 中,Access 查询(与表不同)对于邮件合并目的并不可靠可见。
One of our products is an Access database which includes a table listing thousands of addresses. Our product includes a user friendly interface for searching and filtering out the addresses. These are displayed on a form, let's call it frmAddress.
We include on frmAddress an Export To Excel button which takes the current filter set and exports it to Excel.
To use their filtered addresses as a datasource for a Word mailmerge, end users export to Excel first then used the Excel file as the datasource.
But this is rather a long way round. Is there a way to connect directly to Access and pull out the addresses (the current filter set in frmAddress, not the full table)? If it can't be done directly is there anything that comes close?
The nearest thing I can think of is to save the current filter set every time it changes as the CommandText of a dynamic query, but it seems to me that in Word 2003 Access Queries (unlike Tables) aren't reliably visible for mailmerge purposes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在这里下载我的代码库:
http://www.kallal.ca/msaccess/msaccess.html
(超级简单的单词merge)
那么,合并所需的代码是:
If you download my code library here:
http://www.kallal.ca/msaccess/msaccess.html
(super easy word merge)
Then, the code you need for the merge is: