As mentioned, shellexecute honours the associated file setting in the
registry. As long as the registry entries for pdf and acrobat file are
proper, and the parameters used in making the shellexecute call are valid,
there is no reason why shellexecute would fail that I know of.
--
Randy Birch
MS MVP, Visual Basic
http://vbnet.mvps.org/
Please respond to the newsgroups so all can benefit.
"Tim Reed" <daibreadNOSPAM4U@comcast.netwrote in message
news:a-SdndrNrZZ0KmvbnZ2dnUVZ_vmlnZ2d@comcast.com...
"Randy Birch" <rgb_removethis@mvps.orgwrote in message
news:013f926b$0$20287$c3e8da3@news.astraweb.com...
Quote:
Note though that ShellExecute performs the action specified based on the
file association of PDF. If a user or another application has modified
PDF
from opening with Adobe Acrobat, your dad's users won't or may not get the
result he expects.
>
You can use the FindExecutable API to determine what file is currently
associated with PDF files. Acrobat reader's exe is named either acroread
or
acrord32 depending on the version; the full version of acrobat uses a
different file (acrobat.exe?). To use FindExecutable you point the API at
a
file of interest (e.g. the PDF file or any dummy (empty) file that has a
PDF
extension that you create), and the call returns the executable used to
open
that file based on the registry settings of the user.
>
By using FindExecutable he can therefore determine/ensure the exe file
name
matches an application appropriate for his PDF help file (by testing the
return value with Instr()), then - his choice - either use exe returned
from
the call to open the PDF file directly (the full path and filename is
returned), or proceed to call Shell Execute knowing that will open the
file
as expected.
>
A FindExecutable demo can be seen here
(
http://vbnet.mvps.org/code/system/findexecutable.htm) and a complete
example of what Shell Execute can do can be seen at
http://vbnet.mvps.org/code/shell/shellexecute.htm
Thanks for the additional info, I have passed it along.
But ... curiously, ShellExecute didn't work for him as expected:
Quote:
>I never solved the error to the effect that no application was found to
>associate with .pdf extention -- which is coo-coo, since clicking on any
>.pdf file in Windows Explorer does open it via Acrobat Reader, and I did
>find an association via RegEdit.
If invoking a PDF by doubleclicking on it works (opens it in Acrobat
Reader), why would ShellExecute behave any differently?