Call Help Files

mazza

Registered User.
Local time
Today, 11:22
Joined
Feb 9, 2005
Messages
101
In my database I have a help File which has been created using HTML helpworkshop

I call the program using the following code

'Shell "HH.exe C:\program files\compair service management\Help CompAir Servicing.chm", vbNormalFocus

The problem I have is that my database is distributed to Germany, Spain etc where C:\Program Files is actually called C:\Programme or something different depending on the Windows language version.

I tried replacing C:\program files with $(programfiles)\.... however that doesn't seem to work.

Does anyone have any suggestions?
 
The Environ() function should help you out.

Code:
MsgBox "Program Files location = " & Environ("ProgramFiles")
Search around for I have a db example that lists all the Environ values.
 
If the db and the help file are located in the same directory then you can use this...

Code:
MsgBox "Location of db = " & CurrentProject.Path
 
As usual I ended up taking the long route I tried

Dim Location As String

Location = Environ("ProgramFiles") & "\compair service management\Help CompAir Servicing.chm"
Shell "HH.exe Location", vbNormalFocus


it called the HTML Help program but did not displayed the contents


ended up with this option

Location = Environ("ProgramFiles")

If Location = "C:\Program Files" Then Shell "HH.exe C:\program files\compair service management\Help CompAir Servicing.chm", vbNormalFocus
If Location = "C:\Programme" Then Shell "HH.exe C:\programme\compair service management\Help CompAir Servicing.chm", vbNormalFocus
If Location = "C:\Archivos de Programas" Then Shell "HH.exe C:\Archivos de programmas\compair service management\Help CompAir Servicing.chm", vbNormalFocus


Is there a better way?
 
I prefer to use the ShellExecute method to open a file. It does not have the problems and limitations that the Shell() function does.

I have a working example in my Browse [Find a directory or file] sample.
 

Users who are viewing this thread

Back
Top Bottom