Launch Acrobat

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to launch Adobe Acrobat from a module. The application will be
used by various users who may have different versions of Acrobat, and thus
different paths to the executable.

Can this be done?

Thanks in advance.
 
Are you opening a specific pdf?

You could:

Application.FollowHyperlink "C:\Document.pdf"

or try:

Shell ("AcroRd32.exe")


Chris Nebinger
 
Actually I wasn't really asking the right question, apologies.

I wish to open a particular PDF document and I am using the following code:
Application.FollowHyperlink "C:\Test.pdf"

On my PC this works fine, but I have several user PCs where this momentarily
opens the document and then it instantly closes.

I am able to achieve what I want using Shell() like this:
Call Shell("C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe
C:\Test.pdf", 1)

However I am concerned that some users could have different versions of
Acrobat which may be in different locations.

Can anyone help?

Thanks in advance.
 
For the time being I have solved my own problem like this, but it is not
ideal. Any better solutions will be appreciated:


Dim AppName As String
AppName = ""
If Dir("C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe") =
"AcroRd32.exe" Then
AppName = "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"
ElseIf Dir("C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe") =
"AcroRd32.exe" Then
AppName = "C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe"
ElseIf Dir("C:\Program Files\Adobe\Acrobat 8.0\Reader\AcroRd32.exe") =
"AcroRd32.exe" Then
AppName = "C:\Program Files\Adobe\Acrobat 8.0\Reader\AcroRd32.exe"
ElseIf Dir("C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe") =
"AcroRd32.exe" Then
AppName = "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe"
Else
MsgBox "Can't find the PDF viewer on your computer. It may not be
installed or it is somewhere wierd. Please inform the Finance department."
End If
If AppName <> "" Then AppName = AppName & " C:\Test.pdf": Call
Shell(AppName, 1)
 
I am able to achieve what I want using Shell() like this:
Call Shell("C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe
C:\Test.pdf", 1)

What about just

Call Shell("c:\test.pdf",1)

and let the user control what application he or she wants to read the
things with?

Tim F
 
Back
Top