• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

close pdf via vba

If you don't mind using Early binding and set a reference, it's short and sweet.
Code:
'This uses early binding
'Set reference to Adobe Acrobat
Sub ClosePDFs()
Dim ac As AcroApp
Set ac = New AcroApp
ac.CloseAllDocs
End Sub
 
Only need the Adobe Acrobat XX.X Type Library, turn off the other Adobe/Acrobat libraries.
upload_2015-6-18_10-19-28.png
 
Code:
Function ClosePDFs()
Dim ac As AcroApp

Set ac = New AcroApp
ac.CloseAllDocs

End Function]

Hello,
This code works to close a PDF document that is open, but how do I kill the Acrobat application or Exit the Acrobat program?
"ac.Exit" does not seem to work.

I have Acrobat v10 type library loaded.
 
Got something to work.
New code below
Code:
Function ClosePDF()
Dim ac As AcroApp
Dim ad As AcroApp

Set ac = New AcroApp
ac.CloseAllDocs
Set ad = New AcroApp
ad.Hide

End Function
 
Back
Top