Home All Groups Group Topic Archive Search About
Author
25 May 2005 8:14 PM
Jennifer W
Does anybody know how, from VB 6 , I can run Internet Explorer and show an
htm  file from the disk drive ?

I'm using Windows XP

Thanks, Jennifer

Author
25 May 2005 8:39 PM
Steven Burn
ShellExecute

'// Declares
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

'// Form code
Private Sub Command1_Click()
    Dim strURL As String
    strURL = "http://www.microsoft.com"
    ShellExecute hwnd, "open", strURL, vbNullString, vbNullString, vbNormalFocus
End Sub

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Show quoteHide quote
"Jennifer W" <jennif***@beyonddoubt.net> wrote in message news:eVKYXZWYFHA.2348@TK2MSFTNGP14.phx.gbl...
> Does anybody know how, from VB 6 , I can run Internet Explorer and show an
> htm  file from the disk drive ?
>
> I'm using Windows XP
>
> Thanks, Jennifer
>
>
Author
25 May 2005 8:39 PM
Steve Easton
The following opens a file named kmhelp.htm located in C:\Gnupg\Help\kmhelp.htm
Rename files and paths as needed.


Option Explicit

Public Declare Function GetDesktopWindow Lib "user32" () As Long
      Const SW_SHOWNORMAL = 1
      Const SE_ERR_FNF = 2&
      Const SE_ERR_PNF = 3&
      Const SE_ERR_ACCESSDENIED = 5&
      Const SE_ERR_OOM = 8&
      Const SE_ERR_DLLNOtfOUND = 32&
      Const SE_ERR_SHARE = 26&
      Const SE_ERR_ASSOCINCOMPLETE = 27&
      Const SE_ERR_DDETIMEOUT = 28&
      Const SE_ERR_DDEFAIL = 29&
      Const SE_ERR_DDEBUSY = 30&
      Const SE_ERR_NOASSOC = 31&
      Const ERROR_BAD_FORMAT = 11&

Public 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 Sub Command1_Click()
Dim seehlp As Long, msg As String
        seehlp = showhelp("kmhelp.htm")
End Sub


Private Function showhelp(DocName As String) As Long
          Dim Scr_hDC As Long
          Scr_hDC = GetDesktopWindow()
         showhelp = ShellExecute(hwnd, "open", "iexplore.exe", _
      "  C:\Gnupg\Help\kmhelp.htm", vbNullString, 10)
End Function




--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer

Show quoteHide quote
"Jennifer W" <jennif***@beyonddoubt.net> wrote in message
news:eVKYXZWYFHA.2348@TK2MSFTNGP14.phx.gbl...
> Does anybody know how, from VB 6 , I can run Internet Explorer and show an
> htm  file from the disk drive ?
>
> I'm using Windows XP
>
> Thanks, Jennifer
>
>
Author
25 May 2005 8:49 PM
Tim Baur
"Jennifer W" <jennif***@beyonddoubt.net> wrote in
news:eVKYXZWYFHA.2348@TK2MSFTNGP14.phx.gbl:

> Does anybody know how, from VB 6 , I can run Internet Explorer and
> show an htm  file from the disk drive ?
>
> I'm using Windows XP
>
> Thanks, Jennifer
>
>

If you want to do it in-process and with events, look at adding a
WebBrowser control to a form.


Reference Component:
        Microsoft Internet Controls (shdocvw.dll)

Usage:
    WebBrowser1.Navigate "www.windows.com"
Author
25 May 2005 8:56 PM
Larry Serflaten
"Jennifer W" <jennif***@beyonddoubt.net> wrote
> Does anybody know how, from VB 6 , I can run Internet Explorer and show an
> htm  file from the disk drive ?
>
> I'm using Windows XP


Here is one method:

Private Sub Command1_Click()
  With CreateObject("InternetExplorer.Application")
   .Navigate2 "D:\temp\choose.htm"
   .Visible = True
  End With
End Sub


LFS
Author
25 May 2005 9:06 PM
Karl E. Peterson
Larry Serflaten wrote:
Show quoteHide quote
> "Jennifer W" <jennif***@beyonddoubt.net> wrote
>> Does anybody know how, from VB 6 , I can run Internet Explorer and
>> show an htm  file from the disk drive ?
>>
>> I'm using Windows XP
>
> Here is one method:
>
> Private Sub Command1_Click()
>   With CreateObject("InternetExplorer.Application")
>    .Navigate2 "D:\temp\choose.htm"
>    .Visible = True
>   End With
> End Sub

Leave it to you, to come up with that! <g>

(Just *trying* to piss off all the Firefox users, are ya? <bg>)
--
Working Without a .NET?
http://classicvb.org/petition
Author
26 May 2005 3:16 AM
Martin
>"Jennifer W" <jennif***@beyonddoubt.net> wrote
> Does anybody know how, from VB 6 , I can run Internet Explorer and show an
> htm  file from the disk drive ?
>
> I'm using Windows XP

How 'bout this:

Option Explicit

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


Private Sub Command1_Click()

ShellExecute 0&, vbNullString, "C:\MyFolder\MyFile.htm", vbNullString,
vbNullString, vbNormalFocus

End Sub
Author
25 May 2005 9:10 PM
mr_unreliable
hi Jennifer,

You can instantiate IE by either early or late-binding.

The late-binding version is:
     Set oIE = CreateObject("InternetExplorer.Application")

This is probably not necessary:

       oIE.Visible = True

To show an html page:

       oIE.Navigate("myPath\myFile.htm")

InternetExplorer has an "automation interface" which you
can read about on msdn.  In short, you can do anything
from vb that you can do using IE with a mouse and keybd.

cheers, jw

Jennifer W wrote:
Show quoteHide quote
> Does anybody know how, from VB 6 , I can run Internet Explorer and show an
> htm  file from the disk drive ?
>
> I'm using Windows XP
>
> Thanks, Jennifer
>
>