The specified PDF document is shut. However, even if the PDF document has been changed, preservation is not done.
Only Acrobat can be used. It is not possible to use it with Acrobat Reader.
Syntax
[DocClose(char* fullPath)]
Argument
fullPath [char*] |
The full path of PDF file |
Returns
true | The PDF document is closed successfully |
false | Otherwise. |
Notes: The return value cannot be acquired with DDE of VBA of Excel.
Sample: VBA of Excel
The specified PDF document is shut.
- Please confirm the test by the step execution with F8 key.
Sub DDE_DocClose()
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 Started.
‘Attention: It is necessary to change passing by the environment.
Shell “C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe”
‘Open of DDE channel
lChanNo = DDEInitiate(“Acroview”, “Control”)
‘Open of PDF file
DDEExecute lChanNo, “[DocOpen(“ & strFilePath & “)]”
‘Close of PDF file
DDEExecute lChanNo, “[DocClose(“ & strFilePath & “)]”
‘the Acrobat applicaton is ended.
‘If this is not done, the Acrobat process remains.
DDEExecute lChanNo, “[AppExit()]”
‘The DDE channel is shut.
DDETerminate lChanNo
End Sub
Remarks
- It is not.
Environment to confirm the operation
- WindowsXP + SP3 + WindowsUpdate
- Acrobat Reader 8.1 + Office Pro 2003
- Acrobat Reader 9.1.0 + Office Pro 2003