如何使用 VB 在实时 Word 文档中多次插入 SQL Server 结果

发布于 2024-07-18 11:43:56 字数 83 浏览 1 评论 0原文

好吧,我一直在尝试弄清楚如何进行邮件合并、使用该信息进行 MS SQL 调用以及如何将字符串返回到 Word 文档中。 我猜是VB,但我没有VB经验。

Ok, I'm stuck trying to figure out how to take a mail merge, use that info to make MS SQL calls and get strings back in a word document. I'm guessing VB but I have no VB experience.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

隐诗 2024-07-25 11:43:56

如果您想使用 SQL Server 中的数据进行邮件合并(无论如何在 Word 2003 中),邮件合并向导的第 3 步中有一个选项:

使用现有列表 > 邮件合并。 浏览> 新的 SQL Server 连接

如果您想从其他数据源获取邮件合并的结果,然后使用这些结果查询 SQL Server,那么您将需要 VBA。 除了弄清楚如何操作 Word 对象模型中的数据之外,您还需要类似 ActiveX 数据对象 (ADO) 用于数据库查询

If you want do a mail merge using data from SQL Server then (in Word 2003 anyway) there's an option on step 3 of the mail merge wizard:

Use an existing list > Browse > New SQL Server connection

If you want to take the results of a mail merge from some other data source and then query SQL Server with those results then you're going to need VBA. As well as working out how to manipulate data in the Word object model, you're going to need something like ActiveX Data Objects (ADO) for the database queries

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文