Copy link to clipboard
Copied
Hi,
I have a batch of pdf files which I want to print on 2 identical printers simultaneously in the correct order. Currently, I am using a Word vba macro to do this on a Windows 11 system. The macro opens each document in Adobe Acrobat and prints using OLE Automation and using Adobe Acrobat 10.0 Type Library. Here is my current workflow:
Then repeat these steps for the next document. And so on.
While this all works fine, it seems inefficient and slow, needing to open the same document twice to print to the two separate printers. On opening the document, Acrobat prints to the default Windows printer, hence the need to close it, change the default printer, then reopen it.
Surely, there must be a better way to do this. It should be possible to achieve this:
My macro uses PrintPagesSilent to print the documents.
My question is:
Is there a command to select the printer in Acrobat before executing the .PrintPagesSilent command or a command that prints to a specific printer?
I can't seem to find one.
Based on some research, I have explored using a javascript object in VBA. Here's an extract:
If AcroAVDoc.Open(DocName, "") Then
Set acroPDDoc = AcroAVDoc.GetPDDoc
Set jso = acroPDDoc.GetJSObject
Set pp = jso.getPrintParams
pp.PrinterName = "Myprinter"
pp.interactive = pp.Constants.interactionLevel.automatic
jso.Print (pp)
AcroApp.CloseAllDocs
AcroApp.Exit
End If
However, this gets stuck on the last line: 'jso.Print (pp)'
I would be grateful for any assistance to streamline my workflow.
Many thanks!
Copy link to clipboard
Copied
I have solved my issue. Please ignore this request. If possible, perhaps someone can delete this question. Thanks!