All open PDF files are shut. Afterwards, Acrobat (Or, Acrobat Reader) application is ended.
It is possible to use it by both Acrobat and Acrobat Reader.
Syntax
[AppExit()]
Returns
true | Application is exitted successfully. |
false | Otherwise. |
Notes: The return value cannot be acquired with DDE of VBA of Excel.
Sample: VBA of Excel
When the PDF document is displayed, Acrobat (Or, Acrobat Reader) application is ended.
- Please confirm the test by the step execution with F8 key.
Sub DDE_AppExit()
Dim lChanNo As Long ‘DDE channel number
Dim strFilePath As String ‘The full path of PDF file
‘A double quotation mark is added for blank starting full path
strFilePath = “””E:\iac_developer_guide.pdf”””
‘The Acrobat Reader application is start
Shell “C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe”
‘Open of DDE channel
lChanNo = DDEInitiate(“Acroview”, “Control”)
‘PDF file is open, and it displays it on the screen
DDEExecute lChanNo, “[DocOpen(“ & strFilePath & “)]”
‘All PDF is shut, and the Acrobat application is end
DDEExecute lChanNo, “[DocOpen(“ & strFilePath & “)]”
‘All PDF is shut, and the Acrobat application is end
‘The process disappears from the memory
DDEExecute lChanNo, “[AppExit()]”
‘The DDE channel is shut
DDETerminate lChanNo
End Sub
DDEExecute lChanNo, “[AppExit()]”
‘The DDE channel is shut
DDETerminate lChanNo
End Sub
Remarks
- The process of Acrobat doesn’t remain. It disappears from the memory.
- If this method is not executed at the end, the process of Acrobat of the memory remains.
- When ending, all opened PDF documents are shut.
Environment to confirm the operation
- WindowsXP + SP3 + WindowsUpdate
- Acrobat Reader 8.1 + Office Pro 2003
- Acrobat Reader 9.1.0 + Office Pro 2003