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

x
  • 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.
0
DavidH7470
Asked:
DavidH7470
1 Solution
 
aikimarkCommented:
open the PDF in read-only mode
0
 
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.
0
 
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
0

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