简体   繁体   English

最终用户是否可以使用 Access 中设置的当前筛选器作为 Word 邮件合并的数据源?

[英]Is there a way for end users to use the current filter set in Access as the datasource for a Word mailmerge?

One of our products is an Access database which includes a table listing thousands of addresses.我们的产品之一是 Access 数据库,其中包含一个列出数千个地址的表格。 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.这些显示在一个表单上,我们称之为 frmAddress。

We include on frmAddress an Export To Excel button which takes the current filter set and exports it to Excel.我们在 frmAddress 上包含一个导出到 Excel 按钮,该按钮获取当前过滤器集并将其导出到 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.要将过滤后的地址用作 Word 邮件合并的数据源,最终用户首先导出到 Excel,然后使用 Excel 文件作为数据源。

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)?有没有办法直接连接到 Access 并提取地址(在 frmAddress 中设置的当前过滤器,而不是完整的表)? 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.我能想到的最接近的事情是将当前过滤器集每次更改为动态查询的 CommandText 时保存,但在我看来,在 Word 2003 中,访问查询(与表不同)对于邮件合并目的并不可靠。

If you download my code library here: http://www.kallal.ca/msaccess/msaccess.html如果你在这里下载我的代码库: http://www.kallal.ca/msaccess/msaccess.html

(super easy word merge) (超级简单的单词合并)

Then, the code you need for the merge is:然后,合并所需的代码是:

Dim strSql      as string

strSql = "select * from tblCustomers where " & me.Filter

MergeAllWord strSql

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Access 中的 Word MailMerge 未接收查询 - Word MailMerge from Access is not picking up query 访问SQL查询以进行邮件合并 - Access SQL query to mailmerge 访问 VBA - 使用书签删除过滤器并留在当前记录 - Access VBA - use Bookmark to remove filter and stay on current record 我可以使用MailMerge和MS Words作为报告生成器而不是访问报告吗? - Can I use MailMerge and MS Words as Report Generator instead of Access Report? word mailmerge中与IF/OR Staement的多字段比较 - Multiple field comparison with IF/OR Staement in word mailmerge 在 Access 中为最终用户创建动态“复选框”查询 - Create a dynamic "checkbox" query in Access for end users MS Access显示当前用户未显示用户名 - MS Access show current users not showing username 为多个用户和文件设置从Excel到Access的VBA ADO连接的正确方法是什么? - What is correct way to set up VBA ADO connection from Excel to Access for multiple users and files? 根据当前的SharePoint用户筛选访问Web表单 - Filter an Access Webform based on current SharePoint User 来自 Access 多行文本框的邮件合并,其中输入键行为设置为字段中的新行导致行之间的 CRLF 提供了很大的空间 - Mailmerge from Access multi line text box with Entry Key Behaviour set to New Line in Field causes CRLF between the lines giving a big space
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM