Link to home
Start Free TrialLog in
Avatar of andyw27
andyw27

asked on

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.
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

why not just refer to the path of the pdf file and open the pdf file with

followhyperlink pathtoPDFFile

or use the Shell command
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.
Avatar of andyw27
andyw27

ASKER

I'm using 2003
For what it's worth I'm using Access 2007 and Adobe Reader version 9.3.2, and I get the same behaviour.
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"
Avatar of andyw27

ASKER

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?
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
Avatar of andyw27

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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).