|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||||||
|
||||||||
|
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:
but it sticks "http://" in front of the filename, and can't find the file. I've tried such things as: Visual Basic Code:
and 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? |
|
#2
|
|||
|
|||
|
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).
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
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... |
|
#4
|
|||
|
|||
|
There is a helpful htmlhelp section at http://www.mvps.org
|
|
#5
|
||||
|
||||
|
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. |
|
#6
|
|||
|
|||
|
Quote:
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 |
|
#7
|
||||
|
||||
|
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. |
|
#8
|
|||
|
|||
|
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. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Launching HTML File with Shell Command |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|