[Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 756
  • Last Modified:

VB Excel Macro to Print and Close a PDF

I am using Acrobat X and Excel 2013 and have found code to open a PDF, fill in the fields from cells in a workbook.  Now I would like to know how (from the same module) to print the PDF and then close it without Adobe asking if I want to save it.
1 Solution
open the PDF in read-only mode
Karl Heinz KremerCommented:
You cannot learn how to program with and for Acrobat by picking up sample code on the Internet. There is only one source that will give you all the information, and that is the Acrobat SDK: http://www.adobe.com/devnet/acrobat.html

Take a look at the IAC (Interapplication Communication) section in the SDK documentation. You will find routines to print your document. To,prevent the save dialog, you need to reset the "dirty" flag. If that is set to false, Acrobat or Reader will not prompt you, and will just close the document.
DavidH7470Author Commented:
This all seemed to work from coding found on the internet.

Dim PDFDoc As AcroAVDoc
Set PDFDoc = CreateObject("AcroExch.AVDoc")
PDFDoc.PrintPagesSilent 0, 1, 2, True, True
PDFDoc.Close True

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now