Getting path to default PDF viewer?

  • Thread starter Thread starter johnb41
  • Start date Start date
J

johnb41

In my application, if a user tries to open up a PDF file, I want the
users "default" PDF viewer to open up and display it. By default, i
mean, either the free Acrobat Reader, or the full Adobe Acrobat
licensed software, if installed.

Any idea how I can find out the path name to the .exe? (as it may vary
from user to user)

Thanks!
John
 
johnb41 said:
In my application, if a user tries to open up a PDF file, I want the
users "default" PDF viewer to open up and display it. By default, i
mean, either the free Acrobat Reader, or the full Adobe Acrobat
licensed software, if installed.

Any idea how I can find out the path name to the .exe? (as it may vary
from user to user)

It's all in the registry. I *think* this is the correct sequence to
follow:

HKCR\.pdf:(Default)
This should be "AcroExch.Document"
HKCR\AcroExch.Document\shell\open\command:(Default)
On my machine this is
"C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe" "%1"

Substitute your filename in for %1 and there you have the command line
to run.
 
johnb41 said:
In my application, if a user tries to open up a PDF file, I want the
users "default" PDF viewer to open up and display it.

A better way to do this than finding the PDF viewer EXE is to simply tell
Windows to open the file with its default viewer. You can do this as
follows:

\\\
Dim proc As New Process
'Set the process details
With proc.StartInfo
'Set the information for the file to launch
.FileName = "C:\YourPDFFile.pdf"
.UseShellExecute = True
End With
'Open the file
proc.Start()
///
 
Oenone said:
A better way to do this than finding the PDF viewer EXE is to simply tell
Windows to open the file with its default viewer. You can do this as
follows:

Aaargh and I knew that as well. In my defence, it's very warm here...
our aircon has failed :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top