For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Syntax > March 2005 > Pdf opening problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Pdf opening problem
Trimbitas Sorin

2005-03-10, 4:02 pm

Hello
I'm trying to open a PDF file inside a form but it doesn't seem to work
properly(the application stops responding)... I have registered the ActiveX
which came with Adobe Acrobat Reader 7 and added a control to my form.

Here is the code i used ...
----
pDF1.Top = 50
pDF1.Left = 50
pDF1.Width = Me.Width - 250
pDF1.Height = Me.Height - 1000
pDF1.LoadFile(DelSlash(App.path & "\test.pdf"))
------

Thank you


Ken Halter

2005-03-10, 9:00 pm

"Trimbitas Sorin" <nekhbet(NO SPAM)@go.ro> wrote in message
news:u1i$kaaJFHA.2980@TK2MSFTNGP10.phx.gbl...
> Hello
> I'm trying to open a PDF file inside a form but it doesn't seem to work
> properly(the application stops responding)... I have registered the
> ActiveX which came with Adobe Acrobat Reader 7 and added a control to my
> form.
>
> Here is the code i used ...
> ----
> pDF1.Top = 50
> pDF1.Left = 50
> pDF1.Width = Me.Width - 250
> pDF1.Height = Me.Height - 1000
> pDF1.LoadFile(DelSlash(App.path & "\test.pdf"))
> ------
>
> Thank you


fwiw, I just dropped one on a form and pointed it to it's own help file...
This seems to work fine.
What does that "DelSlash" function do? Maybe it should look more like
pDF1.LoadFile(DelSlash(App.path) & "\test.pdf")
'==================
Option Explicit

Private Sub Form_Load()
Call AcroPDF1.LoadFile _
("C:\Program Files\Adobe\Acrobat 7.0\Help\ENU\Reader.pdf")
Me.WindowState = vbMaximized
End Sub

Private Sub Form_Resize()
AcroPDF1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
End Sub
'==================

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Sign up now to help keep VB support alive - http://classicvb.org/petition
Please keep all discussions in the groups..


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com