Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding help files

Status
Not open for further replies.

MAVTCR

Programmer
Feb 23, 2021
28
IN
I have developed a programme in VB6. I want to provide a help file for the users.I have already created a word file in the application folder. How can I link this through Menu. Please help me. Is there any other method using some other type of file
 
>I have already created a word file
In Word, I would save it as "Web Page (*.htm, *.html)", and place it somewhere accessible to all users (a Server?)

To access (open) it from code, you can use this, just pass the Path\FileName:

Code:
Public Sub OpenDocument(strDocPath As String)
Dim G As Long
G = Shell("RUNDLL32.EXE URL.DLL,FileProtocolHandler " & strDocPath, vbNormalFocus)
End Sub

You can also just simply open your Word document with this code (if users have Word installed)

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
I created an html help file and saved in my application folder.In the main menu given an option for Help.When clicked on it a form will open where a command button is there
In the command button have given the following code
Private sub cmdhelp_click()
dim File as string
File=(App.Path &"\HHAhelp.html")
open File as random as #1
Txthelp=txthelp.text+File+vbcrlf
end sub

When I worked the result was
" C:\My Documents\HHA\HHAhelp.html " displayed in the text box txthelp ie. Only the Path was displayed in the text box,not the file content.
I want the file content to be displayed in the text box.

Please help me
 
If you want to show your help file in your web browser, you can do:

Code:
Option Explicit

Private Sub cmdhelp_Click()
Call OpenDocument(App.Path & [red]"\HHAhelp.html"[/red])
End Sub

Public Sub OpenDocument(strDocPath As String)
Dim G As Long
G = Shell("RUNDLL32.EXE URL.DLL,FileProtocolHandler " & strDocPath, vbNormalFocus)
End Sub

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Is it not possible to show in the text box?
 
You can only show TEXT in a TEXT box,
Unless you want to show the TEXT (code) of the html file, which is what you can see if you open your html file in Notepad [ponder]

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
In that case I must be able to show word document in the text box. Am I correct. Then what should be the code.(Instead of Html file, a word document)

I tried your above code but nothing happens.
 
No, you are not correct.
You can only display TEXT in the text box.

>I tried your above code but nothing happens.
Do you have a file [tt]HHAhelp.html[/tt] in the same location where your VB6 application is?
Any errors?

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
>hen clicked on it a form will open ... I want the file content to be displayed in the text box.

OK, so you are coming up with your own help solution, and want to simply display some text in a textbox. But a Word document is not plain text, and its contents cannot be directly displayed in a textbox.

A richtextbox can show formatted text, however - and Word (and wordpad) can create rich text files, so then all you'd need would be a rich textbox control on the form and then something like:

RichTextBox1.LoadFile "c:\HHAhelp.rtf
 
would it be possible to convert my word document HHAhelp to HHAhelp.rtf and how
 
Did you try (in Word):
File -> Save As -> Save as Type: Rich Text Format (*.rtf) [ponder]

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
I converted my word file to rtf and tried the above code Richtextbox.loadfile "C:\HHAhelp.rtf"
Nothing happens
 
>Nothing happens
Weird... No errors? Nothing?
I just added the RichTextBox control to my Form, by default it has RichTextBox1 name, created a simple rtf file, and in command button I have:

Code:
Option Explicit

Private Sub Command1_Click()
RichTextBox1.LoadFile "C:\Andy\MyFILE.rtf"
End Sub

Works like a dream...

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
>the above code Richtextbox.loadfile "C:\HHAhelp.rtf"
>Nothing happens

Nothing? Not even an error message?

The 'above code' assumes, for the purpose of simplicity, that the rtf file has been saved in the root of C. Your file may be saved elsewhere, and you need to modify the example to match your file location. But if the file is in another location, I would have expected an error message. Do you have [tt]On Error Resume Next[/tt] somewhere in your code?
 
Friends , thank you
I got the solution...Using Html help workshop I could set my software as I wished
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top