Loading PDFs, Shell Function

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
 
D

Dave Peterson

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?
 
P

Paul Martin

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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
D

Dave Peterson

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
 
P

Paul Martin

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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
D

Dave Peterson

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).
 

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

Top