Word 自动化程序运行时无法打开 Word 文件 (MSWord 2007)

发布于 2024-08-27 08:50:12 字数 266 浏览 1 评论 0原文

在我的应用程序中,我使用文字自动化从文件中获取文本内容。它工作正常,没有任何问题。但在文字自动化处理的瞬间,如果我打开文字文件,它会抛出一个对话框,其中包含消息(任何文件)

“此文件正在被另一个应用程序或用户使用。 (C:\User\xyz\AppData...\Normal.dotm)”。

当我关闭对话框时,它要求保存文件“normal.dotm”...模板文件。

这种情况仅发生在 MSWord 2007 中MSWord 2003 中没有。谁能告诉我解决方案吗?

In my application i am using word automation to get the text content from the file. It is working fine no issues. But at the instant when word automation is processing, if i open the word file, it is throwing a dialog with message (any file)

"This file is in use by another application or user.
(C:\User\xyz\AppData...\Normal.dotm)".

When I am closing the dialog, it is asking for save the file "normal.dotm"...template file.

This happens only in MSWord 2007 not in MSWord 2003. can any one tell the solution please.

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

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

发布评论

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

评论(1

伤痕我心 2024-09-03 08:50:12

发生这种情况的原因可能是一个 Word 实例已锁定 Normal.dotm,而您的实例修改了它并尝试保存它。

您可以尝试将模板的 Saved 属性设置为 True。试试这个:Application.NormalTemplate.Saved := True。 Word 现在会认为对 Normal.dotm 的更改已保存,并且不应再次尝试保存。

This probably happens because one Word instance has locked Normal.dotm and your instance modifies it and tries to save it.

You can try to set the Saved property of your template to True. Try this: Application.NormalTemplate.Saved := True. Word will now think that changes to Normal.dotm are saved and should not try to save again.

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