DDE : FilePrint

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.

Syntax

[FilePrint(char* fullPath)]

Argument

fullPath
[char*]
The full path of the PDF file to be printed.

Returns

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.

Sub DDE_FilePrint()
    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.
    DDETerminate lChanNo
    Debug.Print Now & “γ€€DDE_FilePrintγ€€Finish”
End Sub

Remarks

  • 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

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA


Hi !
Welcome you.
Please give me
your comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.