Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 13th, 2006, 05:59 PM
cjreynolds cjreynolds is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 361 cjreynolds User rank is Corporal (100 - 500 Reputation Level)cjreynolds User rank is Corporal (100 - 500 Reputation Level)cjreynolds User rank is Corporal (100 - 500 Reputation Level)cjreynolds User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 11 h 47 m 7 sec
Reputation Power: 5
Launching HTML File with Shell Command

It's been a long while since I used VB, so please bear with my ignorance...

I'm using VB6, and I have a subfolder in my application folder called "help" and a file in that folder called "help.htm". I need to launch the help.htm file in a browser window from the cmdHelp_Click event. I've tried using the Shell command, as I have done before to launch web pages:
Visual Basic Code:
Original - Visual Basic Code
    RetVal = Shell("C:\program files\internet explorer\Iexplore.exe help\help.htm", 1)


but it sticks "http://" in front of the filename, and can't find the file.

I've tried such things as:
Visual Basic Code:
Original - Visual Basic Code
    Shell("C:\program files\internet explorer\Iexplore.exe file://.\help\help.htm", 1)


and
Visual Basic Code:
Original - Visual Basic Code
    RetVal = Shell(App.Path & "/help/help.htm", 1)


and other permutations using the same command, but I can't get VB to find the file.

How's the easiest way to accomplish this?

Reply With Quote
  #2  
Old May 13th, 2006, 10:41 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 57 m 26 sec
Reputation Power: 181
I recommend you look into creating a .chm help file, which is easily integrated into a vb6 application to provide F1 help and context-sensitive help if you wish. MS has a htmlhelp workshop you can download (free).

Search for the ShellExecute API function to get a htm file to open in it's default application (or any other file extension for that matter).
Comments on this post
cjreynolds agrees: Thanks! ShellExecute command did the trick!
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old May 14th, 2006, 12:18 AM
cjreynolds cjreynolds is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 361 cjreynolds User rank is Corporal (100 - 500 Reputation Level)cjreynolds User rank is Corporal (100 - 500 Reputation Level)cjreynolds User rank is Corporal (100 - 500 Reputation Level)cjreynolds User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 11 h 47 m 7 sec
Reputation Power: 5
Thanks! I didn't have time to do the HTMLHelp tutorial, but the ShellExecute command did the trick.

I did download the HTMLHelp tutotial - I'll probably use it next time...

Reply With Quote
  #4  
Old May 14th, 2006, 11:00 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 57 m 26 sec
Reputation Power: 181
There is a helpful htmlhelp section at http://www.mvps.org

Reply With Quote
  #5  
Old May 15th, 2006, 04:41 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 1,932 sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 6 Days 22 h 36 m 35 sec
Reputation Power: 1243
Hi,

I know I'm a little late because Doug has already led you to the solution to your problem, but I have just recently had to learn how to do this and thought I would share my findings.

The MS HTMLhelp workshop can be downloaded free but it is only an evaluation version from Indigoware with a limited lifetime and those annoying reminder screens and when you publish your help file it says for evaluation only on the top. I had no budget available to me so I had to find a free alternative. I found a tool called FAR HTML and it is just as powerful as the MS HTMLhelp for Frontpage and I found it much easier to use.

You can download a full working version from here

To use it all you have to do is construct your HTML pages using Frontpage, load up FAR, select Help Express from the menu on the LHS, select the source/destination paths, the home page of your site and give it a name. Selecting "create help" will automatically generate the .chm file for you.

To call your help file from your project download the "VB6 Example application (zipped archive)" from here
and add the HTMLHelpViewer class to your project. You can then use this class to show your file:

Code:
Create global HTML Help Viewer Instance
    Public gobjHelpViewer As New HTMLHelpViewer

' Set path of the Help file
    gobjHelpViewer.HelpFile = App.Path & "\HelpFile.chm"

' Display the default Help topic
    gobjHelpViewer.Show

' Display the Help topic associated with Context ID 1000
    gobjHelpViewer.ShowContext 1000

' Unload the Help viewer
    gobjHelpViewer.Unload
    Set gobjHelpViewer = Nothing


Check out this tutorial for help on using the class.

Sorry, I am only posting this because I spent a day looking at the different options available and I found this to be the quickest way of incorporating a professional looking help file into my project.

Reply With Quote
  #6  
Old May 15th, 2006, 08:01 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 57 m 26 sec
Reputation Power: 181
Quote:
The MS HTMLhelp workshop can be downloaded free but it is only an evaluation version from Indigoware with a limited lifetime and those annoying reminder screens and when you publish your help file it says for evaluation only on the top.

I don't know what you downloaded, but the Microsoft HTML Help workshop from the MS website is not an evaluation version and doesn't add anything to your htmlhelp files.

http://www.microsoft.com/downloads/...&displaylang=en

Reply With Quote
  #7  
Old May 16th, 2006, 02:44 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 1,932 sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 6 Days 22 h 36 m 35 sec
Reputation Power: 1243
I stand corrected, I actually downloaded Help Publisher for Frontpage, I guess I thought it was an MS product because it went hand in hand with Frontpage. I feel like I wasted a whole day going round the houses!!!

Thank you for pointing that out though, I'll download it and give it a try.

Reply With Quote
  #8  
Old May 16th, 2006, 03:33 AM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 57 m 26 sec
Reputation Power: 181
It takes a bit to figure out how to use the htmlhelp workshop, and I understand MS has some new help tools, but hey, it's free And it's nice to have "real" help in your VB projects.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Launching HTML File with Shell Command


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT