简体   繁体   中英

Open office documents in AxWebBrowser control without file download dialog programmatically in vb.net

I am trying to open office files in AxWebBrowser control and i did it programmatically in vb.net. But during opening it shows file download dialog with open,save and cancel button so how can i setup it "Open" always instead clicking on it by mouse.

This happening because the Microsoft Web Browser control does not handle Office documents natively. What you have to do is load it in an ActiveX control within the webpage instead.

You could do something like this :

<script language="javascript">
     function openDoc() {
        var doc = new ActiveXObject("Word.Application");
        doc.visible = true;
        doc.Documents.Open("path.docx");
    } 
    opeDoc();
</script>  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM