By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,190 Members | 1,503 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,190 IT Pros & Developers. It's quick & easy.

Acrobat Reader Path function modification

P: n/a
I have modified my GetAcroPath function to:

Function GetAcroDir() As String
Const LatestVer = 7
Dim strAcroDir(LatestVer - 2) As String
Dim I As Integer

strAcroDir(1) = "C:\Program Files\Adobe\Acrobat 3.0\Reader\"
strAcroDir(2) = "C:\Program Files\Adobe\Acrobat 4.0\Reader\"
strAcroDir(3) = "C:\Program Files\Adobe\Acrobat 5.0\Reader\"
strAcroDir(4) = "C:\Program Files\Adobe\Acrobat 6.0\Reader\"
strAcroDir(5) = "C:\Program Files\Adobe\Acrobat 7.0\Reader\"
strLocatedAcroDir = ""
For I = LatestVer - 2 To 1 Step -1
If Dir(strAcroDir(I), vbDirectory) <> "" Then
strLocatedAcroDir = strAcroDir(I)
Exit For
End If
Next I
GetAcroDir = strLocatedAcroDir
End Function

It allows for Acrobat Reader 7.0 plus allows me to check for the
existence of the directory and AcroRd32.exe separately. It still
assumes that Acrobat Reader is installed into it's default install
directory.

James A. Fortune

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Why do you need this? If you use the FollowHyperlink method, or the
ShellExecute API (see http://www.mvps.org/access/api/api0018.htm at "The
Access Web" for sample code), you'll automatically start with whichever
version is registered.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

<ji********@compumarc.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I have modified my GetAcroPath function to:

Function GetAcroDir() As String
Const LatestVer = 7
Dim strAcroDir(LatestVer - 2) As String
Dim I As Integer

strAcroDir(1) = "C:\Program Files\Adobe\Acrobat 3.0\Reader\"
strAcroDir(2) = "C:\Program Files\Adobe\Acrobat 4.0\Reader\"
strAcroDir(3) = "C:\Program Files\Adobe\Acrobat 5.0\Reader\"
strAcroDir(4) = "C:\Program Files\Adobe\Acrobat 6.0\Reader\"
strAcroDir(5) = "C:\Program Files\Adobe\Acrobat 7.0\Reader\"
strLocatedAcroDir = ""
For I = LatestVer - 2 To 1 Step -1
If Dir(strAcroDir(I), vbDirectory) <> "" Then
strLocatedAcroDir = strAcroDir(I)
Exit For
End If
Next I
GetAcroDir = strLocatedAcroDir
End Function

It allows for Acrobat Reader 7.0 plus allows me to check for the
existence of the directory and AcroRd32.exe separately. It still
assumes that Acrobat Reader is installed into it's default install
directory.

James A. Fortune

Nov 13 '05 #2

P: n/a
Douglas J. Steele wrote:
Why do you need this? If you use the FollowHyperlink method, or the
ShellExecute API (see http://www.mvps.org/access/api/api0018.htm at "The Access Web" for sample code), you'll automatically start with whichever version is registered.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


I do use the ShellExecute API in conjunction with it. I'd rather not
use fHandleFile. I have not considered the FollowHyperlink method yet.
I'd rather prevent errors than catch them. I think the FollowHyperlink
method will likely involve error catching also. Thanks for the
suggestions.

James A. Fortune

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.