Show PDF on form

D.W. Schingenga

Registered User.
Local time
Today, 23:15
Joined
Jun 2, 2005
Messages
29
I want to show a PDF file on a report like it is possible with .JPG file. So in stead of using .jpg files we want to use .pdf files. I tried some OLE objects but could not make it work. My question is, is it possible to do and if so, how?

Thanks in advance,

Dirk
 
Insert > Object

Select "create from file"

Hit Browse, select your file and your done.

Only issue is it will only display 1 page.
 
Hi,

I already tried that, but it only shows a white box with the PDF icon in it. But it does not show the PDF file itself. It also does not give a message that something is wrong. If I look in properties of the object I do not see where the path to the file is. Please give some more help.

Thanks,

Dirk
 
There is a tickbox under the Cancel button to "Display as Icon" make sure its unticked.

the is also a property called "Display type" in the object. That needs to show "content"
 
Sorry, did everything you say, but it will not show the content of my PDF file. If I try to do a new (in stead of use file), it tells me that

a OLE sourceprogram is possibly not registered.
Install OLE sourceprogram again to register the sourceprogram.

But I have no clou what to install here. Maybe you have an idea?

Thanks,

Dirk
 
You may need to upgrade acrobat reader, there is no reason why it should not display.

Have you tried it on another computer?
 
Simple Software Solutions

Hi

Another approach you could take that works for me is to present the user with a list of files in a list box or some other control.

Then when the user double-clicks on a file the following code is executed

nDT = GetDesktopWindow()
nApp = ShellExecute(nDT, "Open", strFile, "", "C:\", SW_SHOWNORMAL)
DoEvents

Where strFile is the name of the file to open

the GetDesktopWindow() is an API which is shown below

Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpszOp As String, _
ByVal lpszFile As String, ByVal lpszParams As String, _
ByVal LpszDir As String, ByVal FsShowCmd As Long) _
As Long
Private Declare Function GetDesktopWindow Lib "User32" () As Long

Const SW_SHOWNORMAL = 1


Place this in the declarations section of the forms code

and call the ShellExecute on the double click of the file name
How you get the files into the list is your preferred method.

Code Master:cool:
 

Users who are viewing this thread

Back
Top Bottom