Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

simple question

Posted on 2003-12-06
7
Medium Priority
?
324 Views
Last Modified: 2010-04-17
how can I load an html page named help.html in a browser window when I press a button named Help_btn in my visual basic program ?
0
Comment
Question by:oostwijk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 24

Expert Comment

by:R_Rajesh
ID: 9890839
try:

Ret& = ShellExecute(0, "open", "c:\help.htm", "", vbNull, SW_SHOWNORMAL)
or
Ret& = ShellExecute(0, "open", "www.google.com", "", vbNull, SW_SHOWNORMAL)
0
 
LVL 24

Expert Comment

by:R_Rajesh
ID: 9890846
Private Sub Help_btn_Click()
Ret& = ShellExecute(0, "open", "www.google.com", "", vbNull, SW_SHOWNORMAL)
End Sub

Rajesh
0
 
LVL 24

Accepted Solution

by:
R_Rajesh earned 200 total points
ID: 9890866
well i forgot to list the function

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 Help_btn_Click()
Ret& = ShellExecute(0, "open", "www.google.com", "", vbNull, SW_SHOWNORMAL)
End Sub
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:oostwijk
ID: 9891809
Hi Rajesh,

It works fine when I use the line :
Ret& = ShellExecute(0, "open", "www.google.com", "", vbNull, SW_SHOWNORMAL)

However when I want to open a offline html page with:
Ret& = ShellExecute(0, "open", "help.html", "", vbNull, SW_SHOWNORMAL)
it doesn't work..

Can you help me out ?

0
 
LVL 24

Expert Comment

by:R_Rajesh
ID: 9891812
give the full path:

Ret& = ShellExecute(0, "open", "c:\html\help.html", "", vbNull, SW_SHOWNORMAL)



Rajesh
0
 
LVL 6

Expert Comment

by:valipotor
ID: 9892272
Maybe you have to use the file protocol , like this
Ret& = ShellExecute(0, "open", "file://c:\html\help.html", "", vbNull, SW_SHOWNORMAL)

0
 
LVL 4

Expert Comment

by:bhartung
ID: 9915030
If you prefer to have programmatic control over the process rather than just shelling out (so that you can get better error information, for example), you could do this instead:

    Dim oIE As Object
   
    Set oIE = CreateObject("SHDocVw.InternetExplorer")
   
    oIE.Visible = True
   
    oIE.Navigate "http://www.sysinternals.com/"
   
    Set oIE = Nothing

If you prefer to use early binding, the TypeLib to Reference in VB is called "Microsoft Internet Controls".
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Six Sigma Control Plans

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question