Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    rickhubner is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2015
    Posts
    9

    PDF Display Problem, Access 2007

    For years I've had unbound objects that display various PDFs. The code has been super simple, however now all I get on the control is the PDF filename rather than a display of the PDF in the control. It seems to be an Acrobat issue more than my coding or Access. I made a test form with a button that runs the following code. Again, all I get is the filename in the control.

    Private Sub Command7_Click()
    Dim arg As String
    arg = "C:\335489\no_image.pdf"

    With Me.PDFframe
    .Enabled = True
    .Locked = False
    .Class = "AcroExch.Document.11"
    .OLETypeAllowed = acOLEEither
    .SourceDoc = arg
    .SourceItem = ""


    .Action = acOLECreateEmbed
    End With
    End Sub

    I'm running Access 2007 and Acrobat XI with Windows 8.1 64bit. The the same issue seems to exist on Win 7 32bit.

    Any help is appreciated - I've searched all over.

    Thanks

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe you are not using the correct version of Acrobat or Acrobat Reader
    .Class = "AcroExch.Document.11"

  3. #3
    rickhubner is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2015
    Posts
    9
    Sorry no, that's not the problem - I tried every possible variation of that.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I used the Wizard to add an unbound object frame control to a form and embed a PDF. Then I executed the following VBA.
    Code:
    With Me.PDFframe
        Debug.Print "Class = " & .Class & vbCrLf & "*************"
        Debug.Print "OLEType = " & .OLEType & vbCrLf & "*************"
        Debug.Print "OLETypeAllowed = " & .OLETypeAllowed & vbCrLf & "*************"
    End With
    The following was the result
    Code:
    Class = AcroExch.Document.DC
    *************
    OLEType = 1
    *************
    OLETypeAllowed = 2
    *************

  5. #5
    rickhubner is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2015
    Posts
    9
    I hear you, but still nothing VBA code-wise updates the object frame. All I get is the filename.

    Also, when I create an unbound object and point to a PDF, the resulting objects properties indicate Class = AcroExch.Document.11

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I was able to get the following to work. Not sure if the update ( .Action = 6 ) did it or what. It seemed as though I was unable to use VBA to affect the .Enabled and .Locked properties. So I adjusted the properties in Design View, via the properties sheet. Also, I decided to go after linked.
    https://msdn.microsoft.com/EN-US/lib.../ff844827.aspx
    Code:
    Dim arg As String
    arg = "C:\Test\PDF_Files\Test2.pdf"
    'arg = "C:\Test\PDF_Files\TestPDF.pdf"
    .Enabled = True
    .Locked = False
    .Class = "AcroExch.Document.DC"
    .OLETypeAllowed = 0
    .SourceDoc = arg
    .SourceItem = ""
    .Action = 1
    .Action = 6

  7. #7
    rickhubner is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2015
    Posts
    9
    First off, thanks for your efforts. I tried your suggestion, still doesn't work.

    I've attached my sample file. It has everything pretty much what you suggested - still won't work for me. I even tried re-registering Acrobat, thinking maybe something was wrong there.
    Attached Files Attached Files

  8. #8
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421
    For years I've had unbound objects that display various PDFs.
    I suspect you have changed OS versions or applied service packs since then and now this doesn't work. You probably lost an OLE server or its registration. I read where MS has removed servers in Office upgrades and I wonder if this is your problem. I can't try your file on my xp 2007 version because of missing references.

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I removed the references ...
    PDF-XChange Viewer
    Adobe Acrobat 10.0 Type Library

    And I was able to use the following. The only thing I edited, was the path.
    Code:
    Private Sub Command7_Click()
       Dim arg As String
    '  arg = "C:\335489\no_image.pdf"
      arg = "C:\Test\PDF_Files\Test2.pdf"
     With Me.PDFframe
       .Enabled = True
       .Locked = False
       .Class = "AcroExch.Document.DC"
       .OLETypeAllowed = 0   'acOLEEither
       .SourceDoc = arg
       .SourceItem = ""
       .Action = 1    'acOLECreateEmbed
       .Action = 6
    End With
    End Sub
    I then added back Adobe Acrobat 10.0 Type Library. I do not have the other reference. The code above still works on my machine.

    This got me to thinking that your machine may have another program that is opening PDF files. There are third party apps that open PDF files. I know when you install Windows 8, Microsoft thought it was a great idea to default to opening PDF's with their version of Acrobat Reader.

    How to make adobe default

    Right click method
    http://www.skipser.com/p/2/p/make-ad...windows-8.html

    I minute into video starts to describe using Default Programs method.
    https://www.youtube.com/watch?v=4nNdVcwsW4E

  10. #10
    rickhubner is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2015
    Posts
    9
    I really appreciate all you effort to help. Acrobat is the default PDF viewer. I cleaned out extra reference files. My code is exactly the same. It still doesn't display the PDF in the Object frame - just the filename. I also tried similar code to embed other file types (Excel) and they worked fine. There's obviously some "issues" with displaying PDFs.

    I noted that you using Access 2013. Perhaps my old Access 2007 doesn't want to play nice with Acrobat XI.

    I'm stumped.

  11. #11
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I suspect you are making the necessary adjustment to
    .Class = "AcroExch.Document.DC"

    I don't know what else to consider. The only thing left would be some sort of malware. I have seen a few types that spoof Acrobat. Maybe try uninstalling Acrobat and reinstalling it.

    The OLE control is old. I have used it with PDF files in version 2003. I can't imagine DC working and XI not. In fact, I know that I have used either X or XI with Access 2010.

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Here's a link where we used Adobe's AcroPDF dll with success in ac2007: http://www.access-programmers.co.uk/...d.php?t=282559

  13. #13
    rickhubner is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2015
    Posts
    9
    Thanks RuralGuy, but that doesn't quite give me the result that I need from an Unbound object (which always used to work for me).

    My old form presented four thumbnail images of PDFs which then allowed the user to open any of them up in Acrobat by clicking on it. The ActiveX control doesn't give me that functionality.

  14. #14
    rickhubner is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2015
    Posts
    9
    Okay, I don't get it. Perhaps you can give me some insight. I had tried going back to earlier versions of Adobe Reader, thinking perhaps something there was the issue with why I couldn't see Adobe objects on my form. Anyway, I finally went back to Adobe 7 and my Access form would miraculously show the Adobe thumbnail. I then updated back to Adobe DC and everything still worked on the Access forms.

    I'd like to understand why that may have fixed things. I need to make it work on other computers in my shop and it seems awfully lame to have to do what I did in order to make it work.

    You mentioned the OLE control being "old". Could the "control" have been messes up? I don't even know how to check any of that stuff. I'm a pretty basic user with just enough skill to get by. Any ideas are appreciated

    Thanks again for your efforts to help me.
    ~Rick

  15. #15
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    I'm sorry Rick but I have very little experience with Adobe Acrobat other than using it once in a while and when I see interesting threads. It's a computer and you know that darn near anything *could* have been goofed up. Good Luck and sorry.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 06-24-2015, 02:38 PM
  2. Access 2007-Display image options
    By lliefveld in forum Access
    Replies: 4
    Last Post: 01-16-2013, 04:12 PM
  3. Access 2007: Can't Display 17 Digit Number
    By HedgeHog in forum Access
    Replies: 9
    Last Post: 08-14-2011, 01:46 PM
  4. Replies: 2
    Last Post: 06-18-2011, 09:55 AM
  5. Replies: 3
    Last Post: 03-27-2009, 06:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums