Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 AxWebBrowser 控件中打开 office 文件,并且我在 vb.net 中以编程方式进行了操作。但是在打开过程中,它会显示带有打开、保存和取消按钮的文件下载对话框,所以我如何设置它“打开”总是而不是用鼠标单击它。
发生这种情况是因为 Microsoft Web 浏览器控件本身不处理 Office 文档。您需要做的是将其加载到网页内的 ActiveX 控件中。
你可以做这样的事情:
<script language="javascript"> function openDoc() { var doc = new ActiveXObject("Word.Application"); doc.visible = true; doc.Documents.Open("path.docx"); } opeDoc(); </script>