Instead of Call Shell or suggestion

G

Guest

I am trying to open PDF files. Well my app works fine if Acrobat is always in the same location. So I need to be able to call the PDF but the Shell command only works for exceutables. Are suggestions? Here is my code for my current (it works fine as long as Acrobat is in the same location

Dim stAppName, stImage, stPrgPath, stExtn, stDirectory, stAvail As Strin
stAppName = "c:\cts\IMAGES\
stImage = (Me!MemberNumber
stExtn = ".pdf
stPrgPath = "c:\Progra~1\Adobe\Acroba~1.0\Acrobat\Acrobat.exe
If Me!Image The
If stImage < 210001 The
stDirectory = "200000
Call Shell(stPrgPath & stAppName & stDirectory & "\" & stImage & stExtn, 1
GoTo Exit_ViewIamge_Clic
End I
End I
 
D

Dirk Goldgar

Earthdog said:
I am trying to open PDF files. Well my app works fine if Acrobat is
always in the same location. So I need to be able to call the PDF
but the Shell command only works for exceutables. Are suggestions?
Here is my code for my current (it works fine as long as Acrobat is
in the same location)

Dim stAppName, stImage, stPrgPath, stExtn, stDirectory, stAvail As
String
stAppName = "c:\cts\IMAGES\"
stImage = (Me!MemberNumber)
stExtn = ".pdf"
stPrgPath = "c:\Progra~1\Adobe\Acroba~1.0\Acrobat\Acrobat.exe "
If Me!Image Then
If stImage < 210001 Then
stDirectory = "200000"
Call Shell(stPrgPath & stAppName & stDirectory & "\" & stImage &
stExtn, 1)
GoTo Exit_ViewIamge_Click
End If
End If

Normally Acrobat or Acrobat reader would be the registered program to
open the PDF file type. If so, you should be able to use
Application.FollowHyperlink to open the PDF file, without knowing where
the application is installed:

Application.FollowHyperlink _
stAppName & stDirectory & "\" & stImage & stExtn
 
V

Van T. Dinh

Application.FollowHyperlink "E:\Docs\ADSL Filter Installation Guide.pdf"

works fine on my PC.

--
Van T. Dinh
MVP (Access)



Earthdog said:
I am trying to open PDF files. Well my app works fine if Acrobat is always
in the same location. So I need to be able to call the PDF but the Shell
command only works for exceutables. Are suggestions? Here is my code for my
current (it works fine as long as Acrobat is in the same location)
 

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