Results 1 to 4 of 4

Thread: Adobe

  1. #1
    Join Date
    May 2004
    Posts
    17

    Unanswered: Adobe

    Hello,

    I want to open a PDF-File (Acrobat Reader) stored on f.e. C:\Adobe\test.pdf from Access using VBA...
    I know that the function "Shell" can help. But can anyone explain how I practically can execute this task in code...?

    Thanks.

  2. #2
    Join Date
    Jul 2004
    Posts
    64
    Here is an example
    Code:
     Private Sub button_click()
     dim strPathAndFileName as string
     
     Call Shell("C:\Program Files\Adobe\Acrobat 4.0\Acrobat\Acrobat.exe " & strPathAndFileName, 1) 
     
     End Sub
    Obviously I left out error handling and the specifics of the file path and name variable, so let me know if you need help with them.. You also need to ensure that acrobat.exe is in the path specified in the example.. You MIGHT can get away with only using acrobat.exe without the path.

  3. #3
    Join Date
    Feb 2004
    Location
    CT,USA
    Posts
    250
    Private Sub CommandButton1_OnClick()

    Dim ctl As Object
    Dim hypaddpdf As String

    hypaddpdf = "C:\Adobe\test.pdf "
    If Dir(hypaddpdf) <> "" Then
    Set ctl = Me!commandButton1
    With ctl
    .Visible = True
    .HyperlinkAddress = hypaddpdf
    eb_pdf_number = 1
    End With
    Else
    ' some other action
    End If
    End Sub

  4. #4
    Join Date
    May 2004
    Posts
    17

    Adobe (2)

    Hello,

    I've used an ActiveX Control to download a .pdf-file into a form. For this to work, you have to give the exact path in the ActiveX Object. Is it possible that this path is given in the ActiveX Control by code.
    The database with the form and the ActiveX Controls shall be used by independant users with their own computers and configuration, so that the path is no fixed information for the ActiveX Control.

    Anybody any suggestions?

    Thanks.

Posting Permissions

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