|
-
Nov 5th, 2000, 09:34 AM
#1
Thread Starter
New Member
Hello I wonder if you could help me with a problem, I am making a cd menu with a HTML
Interface. But I want to have a Form that appears before the HTML menu is loaded.
And here starts my problem, for I dont know how to make VB open a HTML file, or any other file for that matter.
Can you give me the code on how to open a HTML file when I press a button.
You can´t hit what you cant see
-
Nov 5th, 2000, 11:02 AM
#2
Fanatic Member
Use the following API to open the html file in it's default browser, place the code in a module:
Code:
Public 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
Public Const SW_SHOWNORMAL = 1
Public Sub OpenHTML(URL As String)
Dim Success As Long
Success = ShellExecute(0&, vbNullString, URL, vbNullString, "C:\", SW_SHOWNORMAL)
End Sub
then put this code in a button on your form
Code:
Private Sub Command1_Click()
OpenHTML "c:\test.html"
End Sub
Hope this helped.
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
-
Nov 5th, 2000, 01:05 PM
#3
Thread Starter
New Member
I will trie this, thank you for helping.
You can´t hit what you cant see
-
Nov 5th, 2000, 01:18 PM
#4
Fanatic Member
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|