View Single Post
  #5   Report Post  
ODI
 
Posts: n/a
Default Opening Acrobat Reader using VBA

Hi!
File path should come immediately after the programm path:
"C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe D:\test.pdf"
Try it with a local path, if it works try with a static server path and then
a dynamic one to be able to localize the error source. I first had the same
error and I recognized that the path syntax was not right. If you use
variables, watch their values by debugging modus.

Another try could be to map the server drive instead of using \\servername.

Good night... (It's 10.30 pm hier!)

"smogerp" wrote:

Hi, was having similar issues. I have a dynamic location where a document is
saved and then I want to open the document. I tried what you had below. But
when it tried to open it in Acrobat, I get an error in Acrobat "There was an
error opening this document. The file does not exist". I tried:

RetVal = Shell("C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe
\\servername\AAAA-ABCDEFG20051114101850.pdf", vbNormalFocus)


And

sLocation = "\\servername\AAAA-ABCDEFG20051114101850.pdf"
RetVal = Shell("C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe " &
sLocation, vbNormalFocus)

Neither one worked. I can open the file from Acrobat by the File/Open
process. What I need to do is to open the file directly so users don't have
to go find the document.

Any suggestions?

Thanks in advance.

Phill

"ODI" wrote:

Hi again!

If you just want to open the document, try this:

Sub Open_PDF()
Dim RetVal As Double
RetVal = Shell("C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe
D:\test.pdf", vbNormalFocus)
End Sub

Change the path of Acrobat and of the file you want to open. If you don't
know the path you can find it out in cmd-Window with two commands:

C:\assoc .pdf
.pdf=AcroExch.Document
C:\ftype AcroExch.Document
AcroExch.Document="C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe"
"%1"

Hope this helps!
Didem

"Raam" wrote:


Though I have added the Acrobat Library under tools and references I get
an error 429 which says ActiveX component cant create object. Can
you please test this and see if you get to the bottom of this problem?


Sub Open_PDF()
Dim PDDoc As AcroPDDoc
Dim i As Long
Set PDDoc = CreateObject("AcroExch.PDDoc")
i = PDDoc.Open("d:\test.pdf")
End Sub


--
Raam


------------------------------------------------------------------------
Raam's Profile: http://www.excelforum.com/member.php...o&userid=28666
View this thread: http://www.excelforum.com/showthread...hreadid=484759