Link to home
Start Free TrialLog in
Avatar of DavidAbbott
DavidAbbott

asked on

Adobe Execute Problem

Hi

I need the code which would pick up the correct version of Adobe that the user has installed and then execute accordingly, at present all that i can do is hard code.

Any ideas, the following code is from the button.


@Command( [Execute]; "C:\\Program Files\\Adobe\\Acrobat 5.0
\\Reader\\AcroRd32.exe"; "r:\\SPARE PARTS\\PROTECTION PRODUCTS.pdf" )


Thanks
Avatar of HemanthaKumar
HemanthaKumar

Use this command to find the exe that is assocuiated with recent version of acrobat

@regQueryValue("HKEY_CLASSES_ROOT"; "AcroExch.Document\\shell\\open";"command")

This will return the exe file path

~Hemanth
Avatar of DavidAbbott

ASKER

Thanks for the reply would the code be something like this?

@Command( [Execute]; @regQueryValue("HKEY_CLASSES_ROOT"; "AcroExch.Document\\shell\\open";"command")
; "r:\\SPARE PARTS\\PROTECTION PRODUCTS.pdf" )
yes.. but before that check the registry value is not null !!

eg;
pdfExec := @regQueryValue("HKEY_CLASSES_ROOT"; "AcroExch.Document\\shell\\open";"command");
@if( pdfExec = ""; @Prompt([ok];"Error";"No executable found to launch the file !"); @Command( [Execute]; pdfExec ; "r:\\SPARE PARTS\\PROTECTION PRODUCTS.pdf" ) )
Not quite.  The registry query will return something like:
"C:\Program Files\Adobe\Acrobat 6.0\Reader" "%1"

So, you need to pull off the first string as the executable name: "C:\Program Files\Adobe\Acrobat 6.0\Reader"
And, you should dorp the quotes: C:\Program Files\Adobe\Acrobat\Reader

What might work better for you is querying HKCR Software\Adobe\Acrobat\Exe
...which is Ibelieve what Adobe recommends!
Ok, thanks for the help, but am even more confused now
why ?

You have to choose appropriate key that is it
the error message keeps being returned!
What is the error msg ?
"No executable found to launch the file !"
ASKER CERTIFIED SOLUTION
Avatar of HemanthaKumar
HemanthaKumar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial