Loading PDFs, Shell Function

  • Thread starter Thread starter Paul Martin
  • Start date Start date
P

Paul Martin

Hi guys

- I am attempting to load a pdf using the following code:

iStatus = Shell(sDirAndFilePath, vbMaximizedFocus)

- I'm using an API call that successfully returns the Acrobat installation
directory on different computers.

- On one computer, sDirAndFilePath="C:\Program Files\Adobe\Acrobat 5.0\
Acrobat\Acrobat.exe C:\test.pdf" and this works fine.

- On another computer, sDirAndFilePath="C:\Program Files\Adobe\Acrobat 4.0\
Acrobat\Acrobat.exe C:\test.pdf" but this returns an error in Acrobat "File
not found", even though no error is detected in VB.

- On the surace, it appears to be a version issue with Acrobat 4.0, but I don't
know how feasible this is. Does a PDF loaded with v4 require different
syntax to later versions of Acrobat? Any suggestions are appreciated.

Thanks in advance.

Paul Martin
Melbourne, Australia
 
This might not work for you, but why not just start the .pdf file itself. Let
windows find the associated program:

Shell("start C:\test.pdf")

My expertise with API consists of copying and pasting. But did you look at
FindExecutable in your API books?
 
Thanks Dave but your suggestion returns error 54: can't find file.

It appears to be neither an OS nor Acrobat version issue. I have two
computers, both Win98, both with Acrobat v4. One works, one doesn't. I
think maybe I need to reinstal Acrobat on the one that doesn't work.

If anyone has any other illuminations, that'd be great.

Regards

Paul Martin
Melbourne, Australia
 
Is the c:\test.pdf missing or the adobe executable?

When you run the same command from a DOS prompt, what do you get?
start C:\test.pdf
 
Dave

Your suggestion loads a new dos box with a box title of the filename.

I have since uninstalled Acrobat v4 and reinstalled it to no effect. I
then installed Acrobat Reader v5 which fixed it. I then uninstalled
Reader v5 and installed Acrobat v5 and it still worked. I then
uninstalled Acrobat v5 and installed Acrobat v4 and the problem returned
(even though I have it working on other machines with Acrobat v4).

Regards

Paul Martin
Melbourne, Australia
 
It _kind of_ sounds like a file association (well, from a distance).


When it's broken, in windows explorer: try shiftright clicking on the .pdf file
and select OpenWith.

Browse to the version of acrobat (AcroRd32.exe???) and check to always use that
program for that file type.

It might fix something...(or might not have any affect).
 
Back
Top