trying to get Error Number

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a .chm that is called by a cmdButton:

Shell "HH.exe " & CurrentProject.Path & "\myfile.chm", vbNormalFocus

which works, fine, but am trying to give User more info if they delete or move
the .chm file from ProjectPath.

When I try to get an Error number by renaming the chm, I get a dialog box with
"Help" as the title, and just a line that says:
Cannot open the file: (path)\myfile.chm.
It appears that the help compiler generated the diaglog box?

Is there a particular error I can trap to generate a more detailed error
message, or should I just check to see if the file exists in the proper location
before calling the chm file. If the latter, how do I do that?

Thanks, John
 
You can use the Dir function to see if the file exists where you think it
should be:

If Dir("C:\PathToFile\Filename.chm") = "" Then
MsgBox "Cannot find the .chm file!"
End If
 
Back
Top