Typing Vidha
Typing Vidha

Reputation: 1

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.

Upvotes: 0

Views: 314

Answers (1)

Alexander Ryan Baggett
Alexander Ryan Baggett

Reputation: 2397

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>  

Upvotes: 0

Related Questions