禁用 Microsoft Word "Show Repairs" 对话框

Disable microsoft word "Show Repairs" dialog box

在 VBA 中,我循环浏览了数千份文档。该脚本在遇到需要修复的文档时停止。将打开一个标题为:"Show Repairs" 的对话框,其中包含消息:"Errors were detected in thsi file, but Word was able to open the file by making the repairs listed below. Save the file to make the repairs permanent"。

如何覆盖对话框?我很高兴完全跳过该文档。下面是我试过的。

Application.DisplayAlerts = False
Set wrdDoc = wrdApp.Documents.Open(fileName:=strMyFile, PasswordDocument:="?#nonsense@$", ReadOnly:=True, OpenAndRepair:=False)
plication.DisplayAlerts = True

好的解决方案是使用 Documents.OpenNoRepairDialog 而不是 Documents.Open。就这么简单。显然。