Html 在打开文件时抑制MS Word中的对话框警告

Html 在打开文件时抑制MS Word中的对话框警告,html,vba,ms-word,automation,Html,Vba,Ms Word,Automation,我在VBA中使用OLE自动化打开几百个htm文件,并将它们保存为word文档文件 偶尔会显示此对话框: Linked style sheets are only supported in web format files. By saving to this format, all links to style sheets will be lost. 我将Application.displayalerts设置为false-是否有任何方法可以忽略该特定对话框并继续执行。Excel接受应用程序

我在VBA中使用OLE自动化打开几百个htm文件,并将它们保存为word文档文件

偶尔会显示此对话框:

Linked style sheets are only supported in web format files.  By saving to this format, all links to style sheets will be lost.

我将Application.displayalerts设置为false-是否有任何方法可以忽略该特定对话框并继续执行。

Excel接受应用程序。displayalerts=none,Word使用三个长常量:wdAlertsOne、wdAlertsAll和wdAlertsMessageBox。如果使用wdAlertsNone,代码应该可以工作;)

在调用
SaveAs()之前,请尝试添加此行。

Application.ActiveDocument.OptimizeForWord97=True

运气不好,不过还是要谢谢你,因为唯一的选择就是对对话框进行子类化,并向“继续”按钮的窗口发送单击事件!!