Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2006

    Unanswered: Acrobat - Adobe: Filepath problem

    Good morning/evening all,

    Quick overview - I have a database that is about to be put on my works network but a few problems keep arising during testing. One of the headaches I have adopted is with acrobat.

    Pdf's are attached to records for future reference and can be opened by the user. Unfortunately the problem I have come across is that not all users have the same version of Adobe on their computer (something I should have foreseen but overlooked).

    I know that the registry holds the path for the acrobat (assuming its installed on the machine) and I was wondering if there was anyway to fetch that address from within Access?

    If that cant be done I am not sure how else to go about this problem? Typing in the paths of all existing adobe programs would make it work on most computers but as soon as a new version of acrobat comes out the database will fail.

    Any help is most appreciated
    Last edited by phil-owens; 12-18-06 at 05:04.

  2. #2
    Join Date
    Dec 2002
    Préverenges, Switzerland
    here are some hints on hitting the registry with APIs from Wayne that should be helpful.

    meanwhile, i have a lazier approach using the imagehlp API and a one-row-table (where i keep all sorts of setup and preference stuff).

    the API declaration up at the top of the module:
    Private Declare Function SearchTreeForFile Lib "imagehlp" _
        (ByVal SearchRoot As String, ByVal FileName As String, _
        ByVal Foundfile As String) As Boolean
    and a sub that will try to find a file in the location defined in the one-record-table, if not found there then in a default location, and if still not found then will scan c: for it
    replace snapview.exe
    replace c:\Program Files\Common Files\Microsoft Shared\SnapshotViewer\SNAPVIEW.EXE
    c:\program files\adobe\acrobat 7.0\reader\acrord32.exe
    private sub foo()
        'blah blah blah
        'blah blah blah 
        '...resulting in the DAO recordset recs containing my one-record-table
        'goal is to set global var gloSnapView to the full c:\path\path\name.ext
        'AND save the details in the table for next time if not already there
        '   /// make sure snapview is under control
        If Dir(Nz(recs!snappath, "c:\izy> ")) = "" Then   ' "c:\izy> " is doubly-illegal so should not exist
            MsgBox "The utility SNAPVIEW.EXE is not where I expected it to be! " _
                 & "It might be missing or moved." & vbCrLf & "I will search for it on your disk " _
                 & "(might take a moment).", vbOKOnly + vbInformation, "Search for snapview"
            'first try the default location
            tmpSnapPath = "c:\Program Files\Common Files\Microsoft Shared\Snapshot Viewer\SNAPVIEW.EXE"
            If Dir(tmpSnapPath) = "" Then
                'not in default, so scan the whole disk
                tmpSnapPath = String(255, " ")
                If SearchTreeForFile("c:\", "snapview.exe", tmpSnapPath) Then
                    tmpSnapPath = Trim(Replace(tmpSnapPath, Chr$(0), " "))
                    tmpSnapPath = ""
                End If
            End If
            If tmpSnapPath = "" Then
                MsgBox "I was unable to locate SNAPVIEW.EXE and will abort.", vbCritical, "Unable to continue"
                recs!snappath = tmpSnapPath
                MsgBox "I found SNAPVIEW.EXE and saved the location for next time.", vbInformation, "Snapview OK"
            End If
        End If
        gloSnapView = recs!snappath
        'blah blah blah to tidy up
    end sub
    currently using SS 2008R2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts