Development: Microsoft Windows specific

1. Control over OLE automation
Q: I have a general question in regard to OLE automation. I've built an application that controls Acrobat, and I'm trying to make it more robust. The problem I'm having is what to do when I try to open a non-existent file (a fdf pointing to a missing pdf file). Acrobat then displays a dialog box, and waits for user input. Since there's no user to click on the cancel or ok button, my program freezes waiting for Acrobat to respond. Is there any way to pass a "cancel" or something similar to Acrobat via OLE automation? [Q30]
2. Acrobat and DDE
Q: I want to access the Acrobat Reader with DDE by using VB. The DDE-commands are described in http://partners.adobe.com/asn/developer/acrosdk/docs/iac/IACReference.pdf

1. Control over OLE automation

Q: I have a general question in regard to OLE automation. I've built an application that controls Acrobat, and I'm trying to make it more robust. The problem I'm having is what to do when I try to open a non-existent file (a fdf pointing to a missing pdf file). Acrobat then displays a dialog box, and waits for user input. Since there's no user to click on the cancel or ok button, my program freezes waiting for Acrobat to respond. Is there any way to pass a "cancel" or something similar to Acrobat via OLE automation? [Q30]

A: You can get the name of the pdf file that the fdf points to using the FDFGetFile method from the Acrobat forms toolkit. Then use code to verify that the pdf exists (and display a suitable message if it doesn't) before trying to open it via the pdf.

Dan Sideen (dansideen@home.com) [A56]

2. Acrobat and DDE

Q: I want to access the Acrobat Reader with DDE by using VB. The DDE-commands are described in http://partners.adobe.com/asn/developer/acrosdk/docs/iac/IACReference.pdf

I am searching for a working example. [Q155]

A: It took me a long time to get this to work, but it does, at least with Acrobat 4.

 
Sub Printit(FileToPrint As String)
  'Print a file using Acrobat
   Dim sCmd As String
   Dim FullName As String    'defined as string elsewhere
   FullName = FormsHome + "" + FileToPrint
   sCmd = "[FilePrintSilent(" & FullName & ")]"
   frmViewForm.lblDDE.Caption = "Printing..." & FileToPrint
   frmViewForm.lblDDE.LinkTopic = "Acroview|Control"
   frmViewForm.lblDDE.LinkItem = ""
   If frmViewForm.lblDDE.LinkMode <> 2 Then
     frmViewForm.lblDDE.LinkMode = 2
   End If
   frmViewForm.lblDDE.LinkTimeout = 1000
   frmViewForm.lblDDE.LinkExecute sCmd
   frmViewForm.lblDDE.LinkMode = 0
   frmViewForm.lblDDE.Caption = ""
   frmViewForm.lblDDE.LinkMode = 2
   End Sub
 

Dan Sideen (dansideen@home.com) [A238]