HTML Octothorpe in VB

105 Views Asked by At

I am trying to open my html document through VB. Code below:

 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles  Button1.Click
    Process.Start("file:///C:/Users/Michael/Desktop/Final/index.html#SL")
End Sub

My problem is every time it opens the html document it does not go to the Octothorpe(#SL), it only opens this part file:///C:/Users/Michael/Desktop/Final/index.html without the #SL.

Please advise.

Thank you

1

There are 1 best solutions below

1
Squiggs. On BEST ANSWER

Use Process.Start on iexplore.exe, so that you can specify the URL specifically as its argument. You need to specify the default browser for this to work.

System.Diagnostics.Process.Start("iexplore.exe", @"file:///C:/Users/Michael/Desktop/Final/index.html#SL")