Open chm file

moongodess

Active member
Joined
Dec 23, 2004
Messages
40
How can I open a chm file?

I tried the following:


Dim strFile As String
strFile = Application.StartupPath & "\help.chm"

If (System.IO.File.Exists(strFile) = True) Then
System.IO.File.Open(strFile, IO.FileMode.Open
End If
but nothing happened :(
Does anyone knows what am I doing wrong or if there is another way to open this kind of files?
 
you wont actually open the file ( so as to see it ) using File.Open , you need to use Process.Start to do that , eg:
Code:
Dim strFile As String
strFile = Application.StartupPath & "\help.chm"

If (System.IO.File.Exists(strFile)) Then
    System.Diagnostics.Process.Start(strFile) /// launch the chm file to view it.
End If
 
Now, with that code, I got the attached error..
Says something like: Its not possible to open the file: mk:@MSITStore:[FilePath\FileName] :confused:
Does someone have any other idea?
 
No, the file name really is HOSTGestaoPontos.chm.
But now I know what was going on.. It was related to the permissions.. I change some things in file properties, and now it works fine.

Thankx a lot for your help ;)

For someone who need.. Here is the code:



Dim strFile As String
strFile = Application.StartupPath & "\" & mstrFileName

If (System.IO.File.Exists(strFile) = True) Then
System.Diagnostics.Process.Start(strFile)
End If
 
Back
Top