Results 1 to 4 of 4

Thread: Opening HTML

  1. #1
    Syzygy26
    Guest

    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?

  2. #2
    AIS_DK
    Guest
    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"

  3. #3
    Lively Member d4v3's Avatar
    Join Date
    Nov 2001
    Location
    Leicester, UK
    Posts
    82
    Open it like a normal text file, essentially, a HTML file is just text, its translated by your browser.

  4. #4
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. Option Explicit
    2.  
    3.  
    4. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    5.                 (ByVal hwnd As Long, ByVal lpszOp As String, _
    6.                  ByVal lpszFile As String, ByVal lpszParams As String, _
    7.                  ByVal LpszDir As String, ByVal FsShowCmd As Long) _
    8.                  As Long
    9. Private Const SW_SHOWNORMAL = 1
    10.  
    11. Private Sub Command1_Click()
    12.     'Open a web page
    13.     Dim l As Long
    14.     l = ShellExecute(Me.hwnd, "Open", "c:\test.htm", "", "C:\", SW_SHOWNORMAL)
    15. 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
  •  



Click Here to Expand Forum to Full Width