How to Display PDF file on Form (1 Viewer)

Leo_Polla_Psemata

Registered User.
Local time
Today, 08:30
Joined
Mar 24, 2014
Messages
364
Hi
I want to display a pdf file on a form.
I tried the exact steps from this video
https://www.youtube.com/watch?v=UltWxgzgXPk&t=17s
as well as from several other similar

The error I get is
"The OLE server isn't registered"
To register the OLE server, reinstall it"
There is no object in this control"

Do you have any idea how could I solve this problem?
 

Leo_Polla_Psemata

Registered User.
Local time
Today, 08:30
Joined
Mar 24, 2014
Messages
364
https://www.access-programmers.co.uk/forums/showthread.php?t=297837

Hi, I visited the link.
This sample database, in that link, does exactly what I need.
I downloaded in my pc and db works just fine, when I transfer the code to my own database, I get the below error

---
Dim fd As Office.FileDialog

Compile error
User-defined type not defined
---

My knowledge in VBA is rudimentary and I feel I must have missed something very very basic.
Please help. Why id doesn't work in my database? I have crosschecked twice, all names and controls are correct.
 

isladogs

MVP / VIP
Local time
Today, 16:30
Joined
Jan 14, 2017
Messages
18,213
Look at the VBA references in arnels example.
Compare with yours and add any that are missing.
Probably Microsoft Office Object Library but check for yourself
 

Leo_Polla_Psemata

Registered User.
Local time
Today, 08:30
Joined
Mar 24, 2014
Messages
364
I checked.
Indeed , example database has a tick in
Microsoft Office 16.0 Object Library

which I don't find this reference in my database.

Could I update it from somewhwere ?

Alternative, I could transfer the objects from my database into example and continue with example
 

AccessBlaster

Registered User.
Local time
Today, 08:30
Joined
May 22, 2010
Messages
5,937
Microsoft Office 16.0 Object Library, if you have a reference similar to this try it.
 

Ranman256

Well-known member
Local time
Today, 11:30
Joined
Apr 9, 2015
Messages
4,337
you DONT want to display pdf on a form. It looses resolution.
Just open the pdf.
 

isladogs

MVP / VIP
Local time
Today, 16:30
Joined
Jan 14, 2017
Messages
18,213
I checked.
Indeed , example database has a tick in
Microsoft Office 16.0 Object Library

which I don't find this reference in my database.

Could I update it from somewhwere ?

Alternative, I could transfer the objects from my database into example and continue with example

You do have it otherwise it would be marked as MISSING in arnel's example
If its not in the list (it should be...) you need to browse for it
The file you want is called mso.dll and for Office 16.0 (2016) the path will be something like: C:\Program Files\Common Files\microsoft shared\OFFICE16\mso.dll but as I'm using Office 2010 that may not be exactly correct for you

Alternatively you can of course import all your database objects into arnel's example.

Incidentally, I disagree with ranman about the quality of PDF resolution in a web browser utility. Suggest you try for yourself and see what you think
 

Gasman

Enthusiastic Amateur
Local time
Today, 16:30
Joined
Sep 21, 2011
Messages
14,263
You need your version included in the References..

I run 2007, so mine is version 12.
That is included and arnelgp's db runs fine

HTH

I checked.
Indeed , example database has a tick in
Microsoft Office 16.0 Object Library

which I don't find this reference in my database.

Could I update it from somewhwere ?

Alternative, I could transfer the objects from my database into example and continue with example
 

Users who are viewing this thread

Top Bottom