|
-
Dec 22nd, 2001, 08:42 AM
#1
Opening HTML
I need to open a .html file from my VB program but the HTML file is on my hard drive, i.e doesn't have a URL like http://.... The shell command: Call Shell("start http://....", vbHide) doesn't seem to work in this case. How else can I open the HTML file?
-
Dec 22nd, 2001, 08:55 AM
#2
Try having a look at this: http://www.vbworld.com/demos/shellexecute/
Just replace the URL address with the path on you harddrive. IE: "C:\Windows\Temp\My Test.html"
-
Dec 22nd, 2001, 09:31 AM
#3
Lively Member
Open it like a normal text file, essentially, a HTML file is just text, its translated by your browser.
-
Dec 22nd, 2001, 09:37 AM
#4
-= B u g S l a y e r =-
VB Code:
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpszOp As String, _
ByVal lpszFile As String, ByVal lpszParams As String, _
ByVal LpszDir As String, ByVal FsShowCmd As Long) _
As Long
Private Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
'Open a web page
Dim l As Long
l = ShellExecute(Me.hwnd, "Open", "c:\test.htm", "", "C:\", SW_SHOWNORMAL)
End Sub
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
|