I have a VB app that needs to open a pdf document and go to a particular page in it. I'm using the Adobe Acrobat Control for ActiveX (pdf.ocx). The control is called 'pdfmain'.
I have the following code on the form:
Dim Status As Integer
Status = pdfmain.LoadFile(PDF_Filename)
If Status <> -1 Then GoTo errHandler
'PDF_Page = InputBox("What Page?")
pdfmain.setCurrentPage (Project_User.PDF_Page)
pdfmain.Width = Me.Width
pdfmain.Height = Me.Height
When the form opens, you see the Adobe splash screen as the control is loaded. The form opens after the Adobe Splash screen and goes to the exact page it's supposed to. The problem is that when this form is closed, 80% of the time abobe crashes.
But, if I start Adobe Acrobat and minimize it just to have it open, everything works PERFECTLY!
Is there a way to code this differently so it won't crash, or is there a way to load acrobat into memory so it doesn't take too long to load and so the form then closes properly?
Thanks for any assistance!
Steve
I have the following code on the form:
Dim Status As Integer
Status = pdfmain.LoadFile(PDF_Filename)
If Status <> -1 Then GoTo errHandler
'PDF_Page = InputBox("What Page?")
pdfmain.setCurrentPage (Project_User.PDF_Page)
pdfmain.Width = Me.Width
pdfmain.Height = Me.Height
When the form opens, you see the Adobe splash screen as the control is loaded. The form opens after the Adobe Splash screen and goes to the exact page it's supposed to. The problem is that when this form is closed, 80% of the time abobe crashes.
But, if I start Adobe Acrobat and minimize it just to have it open, everything works PERFECTLY!
Is there a way to code this differently so it won't crash, or is there a way to load acrobat into memory so it doesn't take too long to load and so the form then closes properly?
Thanks for any assistance!
Steve