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

x
?
Solved

Loading an HTML file from application

Posted on 1999-06-29
4
Medium Priority
?
129 Views
Last Modified: 2012-05-04
Is there a quick way to load an HTML file from inside a VB program (not in the program, but using their default browser)? Any help would be appreciated.
Thanks,
-Brian
0
Comment
Question by:bstuff
[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
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
y2kwacko earned 80 total points
ID: 1520823
in a module put:

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_NORMAL = 1

in command button or wherever loading the url put:

dim results as long

results = ShellExecute(0, "open", "http://www.msn.com", vbNullString, vbNullString, SW_NORMAL)



0
 
LVL 12

Expert Comment

by:mark2150
ID: 1520824
You can also use the webbrowser control and tell it to do work. See my web page (www.cyberchute.com/rvbus/madmark) for working browser using form with single button and web control. Total source code under 1 page! Source included with project.

M

0
 

Author Comment

by:bstuff
ID: 1520825
Sorry, I guess I wasn't quite clear on that... the HTML file is in the same directory as the program on the hard drive, say, for example, it's "help.html". AppActivate hasn't worked for me and I was wondering if there was any other easy way to do it.

y2kwacko, it's only fair that I give you another chance, since you were the first one to propose and answer (and it was quite lovely, by the way), so I'll let you finish up... if you know how to do it.

Thanks again!
-Brian
0
 
LVL 3

Expert Comment

by:y2kwacko
ID: 1520826
Use the same example just replace the url with the filename of the html file
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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

705 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