These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

XFA Form to VB6 Host Communications

csearl
Registered: Aug 10 2006
Posts: 28

I have a VB6 application that hosts PDF forms designed using LiveCycle Designer 8. The VB6 application uses OLE Automation to load, display and interact with the form. The form is hosted in a VB6 standard form object. However, the form will need to able to get data from the VB6 application for events like button clicks, loading data into drop-down lists, validations, etc.
 
It uses this approach (in VB6) to load and display a PDF file:
 
...
Set AcroExchApp = CreateObject("AcroExch.App")
Set AcroExchAVDoc = CreateObject("AcroExch.AVDoc")
ok = AcroExchAVDoc.OpenInWindowEx(sFileName, Me.hWnd, CLng(AV_DOC_view), True, 0, CInt(PDUseNone), TmpViewMode, iZoomLevel, 0, 0)
 
If Not ok Then
MsgBox "Can't open file: " & sFileName, vbCritical, ""
Set AcroExchAVDoc = Nothing
Set AcroExchApp = Nothing
Exit Function
End If
 
Set AcroPDDoc = AcroExchAVDoc.GetPDDoc
Set AcroExchAVPageView = AcroExchAVDoc.GetAVPageView

Set jsObject = AcroPDDoc.GetJSObject
...
 
None of the AcroExch objects have any events exposed. How can I get my form to access methods or functions from within the VB6 application?
 
Is this possible and, if so, what is the preferred method to do this?

My Product Information:
Acrobat Pro 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You can't, The VB program can talk to your PDF, but the PDF has no awareness of the VB program. You'll need to poll the PDF from VB to figure out when it needs data.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script