An open display, and it does, and the print dialog box of PDF file is displayed. The following instruction is not executed as long as the print dialog box is not shut.
|The full path of the PDF file to be printed.|
|true||The print succeeded. (Operation is unconfirmed.)|
|false||The document specified by fullPath is not opened. The print failed.|
Notes: The return value cannot be acquired with DDE of VBA of Excel.
Sample: VBA of Excel
The PDF document is opened.
- Please confirm the test by the step execution with F8 key.
Dim lChanNo As Long ‘DDE channel number
‘A double quotation mark is added for blank starting full path.
Const CON_PDF_PATH = “””E:\Test01.pdf”””
‘The Acrobat Reader application is Started.
Shell “C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe”
‘Open of DDE channel
lChanNo = DDEInitiate(“Acroview”, “Control”)
‘After PDF file is opened, the print dialog is displayed.
DDEExecute lChanNo, “[FilePrint(“ & CON_PDF_PATH & “)]”
‘The following instruction is not executed as long as the print dialog is not shut.
‘All PDF is shut, and the Acrobat applicaton is ended.
‘The Acrobat process also disappears.
DDEExecute lChanNo, “[AppExit()]”
‘The DDE channel is shut.
Debug.Print Now & “γDDE_FilePrintγFinish”
- The process doesn’t remain in the above-mentioned sample though the problem that the process remains in the memory is seen well for an automatic print that uses Acrobat Reader. This problem doesn’t occur in Acrobat Reader v9.1.
Environment to confirm the operation
- WindowsXP + SP3 + WindowsUpdate
Acrobat Reader 9.1.0 + Office Pro 2003