Ok, last ones for a while. I hope.
Two questions:
- How do I open an HTML file with the webbroswer control, one that is located at a specific place on the HDD?
- How do I Shell an HTML file?
Anyone know?
Printable View
Ok, last ones for a while. I hope.
Two questions:
- How do I open an HTML file with the webbroswer control, one that is located at a specific place on the HDD?
- How do I Shell an HTML file?
Anyone know?
Question 1: I'm just full of questions, aren't I?
A: Questions are very good to be asked. If you get an answer, it's great. Because you learn more.
Question 2: How do I open an HTML file with the webbroswer control, one that is located at a specific place on the HDD?
A:
Needed: CommonDialog
Question 3: How do I Shell an HTML file?Code:On Error GoTo fileOpenErr
CommonDialog1.CancelError = True
CommonDialog1.flags = &H4& Or &H100&
CommonDialog1.DefaultExt = ".htm"
CommonDialog1.DialogTitle = "Select File To Open"
CommonDialog1.Filter = "HTM (*.htm)|*.htm"
CommonDialog1.ShowOpen
webbrowser1.Navigate CommonDialog1.FileName
fileOpenErr:
Exit Sub
A:
Code:Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
ShellExecute Me.hwnd, vbNullString, "c:\htmlfile.htm", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
I need to know how to tell the Webbrowser control how to open it. I'm not familiar with how to write the URL. I think it has to have something like "file:" in it. I already know where the HTML files are located.