• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 489
  • Last Modified:

Viewing PDF inside form

Hi,

Is it possible to view a pdf inside a access form?

I have Adobe 9 Pofessional.  I've clicked on the PDF Reader control in the form builder but I get the following error message:

"The OLE server isn't registered"

Is this even possible?

Thanks.
0
andyw27
Asked:
andyw27
  • 4
  • 3
  • 2
  • +1
1 Solution
 
Rey Obrero (Capricorn1)Commented:
why not just refer to the path of the pdf file and open the pdf file with

followhyperlink pathtoPDFFile

or use the Shell command
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
What version of Access are you using? While the activex control for PDFs isn't certified as Access-compatible by Adobe, many have reported using it with good success, but I've not yet heard of anyone using it in 2007 or higher (although there may be some who do).

You can always use a 3rd party control, assuming you can find one suitable for your environment and needs. There are dozens upon dozens of them.
0
 
andyw27Author Commented:
I'm using 2003
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
JezWaltersCommented:
For what it's worth I'm using Access 2007 and Adobe Reader version 9.3.2, and I get the same behaviour.
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Another method is use the WebBrowser control on a form to show your PDF. You can just set the .Navigate property of the control to the path to your PDF file:

Me.YourWebBrowserControl.Navigate "Full path to your PDF file"
0
 
andyw27Author Commented:
Thanks.

I've tried the browser way but it always open within the Reader and not within the control.

I'm now trying to open the file as per the Shell command.  Having some luck when I hard code the path, but will not work when I try to use a variable, probably just a syntax error but I cannot fix it.

Shell "C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe '" & rsPath.Fields(0) & "'", vbNormalFocus

Also is it possible to open the PDF as read only, maybe via some command switches?
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Shell "C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe " & Chr(34) & rsPath.Fields(0) & Chr(34), vbNormalFocus

Here's a PDF that shows the opening parameters availabe with AcroRd32.exe:
http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf#page=5
0
 
andyw27Author Commented:
Thank you that string works.

How can I further enhance it by using the pararmeters:

I've tried a few ways:

Shell "C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe " & Chr(34) & rsPath.Fields(0) & "#view=Fit" & Chr(34), vbNormalFocus

But I think my syntax is wrong again.
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You need to enclose the Path in quote, but not the command line params:

Shell "C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe " & Chr(34) & rsPath.Fields(0) & Chr(34) &  "#view=Fit", vbNormalFocus

So that you're clear, Chr(34) = "
0
 
JezWaltersCommented:
It's a bad idea to reference fields by their ordinal number - you should use their names instead (i.e. replace "rsPath.Fields(0)" with "rsPath!YourField", where YourField is the appropriate name).
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now