VBA for word:为什么无法访问其他打开的文档?

发布于 2024-10-03 06:13:14 字数 178 浏览 0 评论 0原文

无论我打开多少个word文档,下面的代码总是给我1。

    Sub TestMe()
    MsgBox Application.Documents.Count
    End Sub

有人可以教育我为什么吗?那么如何访问所有其他word文档呢?

谢谢。

the following code always give me 1 no matter how many word documents I opened.

    Sub TestMe()
    MsgBox Application.Documents.Count
    End Sub

Could some one educate me why? and then how to access all other word documents?

thanks.

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

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

发布评论

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

评论(1

顾北清歌寒 2024-10-10 06:13:14

您可能在单独的应用程序实例中(在 WinWord.exe 的单独会话中)打开了每个文档。

您是否在 Word 的 Windows 菜单中看到了这些文档? (或者,在 2007 年以后,切换文档菜单)

You probably opened each document in a separate application instance (in a separate session of WinWord.exe)

Do you see the documents in Word's Windows menu? (Or, in 2007+, the Switch Documents menu)

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