Author Topic: Displaying docs in the webbrowser control  (Read 2041 times)

0 Members and 1 Guest are viewing this topic.

hendie

  • Guest
Displaying docs in the webbrowser control
« on: July 04, 2007, 10:50:01 AM »
I am displaying documents via the webbrowser control with the following code
Code: [Select]
Private Sub ListView1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.Click
        Dim I As Integer
        Dim Fname As String = ListView1.SelectedItems(I).Text
        Dim MyDocs As String = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)

        Dim Path As String = MyDocs & "\" & TreeView1.SelectedNode.FullPath
        Fname = "C:\" & Path & "\" & Fname
        WebBrowser1.Navigate(Fname)

    End Sub

The webbrowser will successfully display *.doc files and *.pdf files but when I select xls files it opens an instance of Excel with the file instead of displaying it.
Any ideas as to why ?... and how to prevent it ?

hendie

  • Guest
Re: Displaying docs in the webbrowser control
« Reply #1 on: July 05, 2007, 09:10:00 AM »
problem solved.
In windows exporer > Tools > Folder Options > File Types
select file type > advanced
make sure "browse in same window" is checked