Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Child/Parent PDF Problem

Status
Not open for further replies.

LFC8

Programmer
Nov 18, 2004
45
0
0
GB
Hi

I been trying to solve this problem I've been having which involves inserting a PDF document into a frame. The strange thing about this problem is it works first time around but doesnt on the second time, I've stepped through the code and it executes the snippet of code which inserts the PDF into the frame but it leaves the PDF outside of the frame. Any ideas guys

Code:
Private Sub Form_Load()
Dim A As Long

A = Shell("C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe /A """" " & sFDFPath, vbNormalNoFocus)

    Do While wHwnd = 0
        DoEvents
         wHwnd = FindWindow("AdobeAcrobat", "Adobe Acrobat Professional") 'For Adobe 6.0
    Loop

    BringWindowToTop wHwnd
    Sleep 1000
    keybd_event vbKeyF9, 0, 0, 0
    keybd_event vbKeyF9, 0, KEYEVENTF_KEYUP, 0
    DoEvents
    A = SetParent(wHwnd, Frame1.hwnd) <<THIS IS WERE THE PDF SHOULD BE INSERTED INTO THE FRAME
    ShowWindow wHwnd, 3
    Call CloseMenu
End Sub


Thanks
 
have you considered using the Acrobat Reader control that comes with Acrobat reader 7?
 
Hi strongm

Thanks for your reply but the problem was it was retaining the handle value so I needed to reset the value back to zero!

such a small problem which had a massive impact on my program

The joys of programming hey :)

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top