How To USE OLE Automation for PDF

i need to develope a script that allows me to print an attached pdf file using ole automation. I know it is very similar to the one below that prints attached MS Word documents. What is the CreateObject parameter to pass? How do I close it after it prints, so that the user does not have to close it.

Dim app As Variant 

Dim docToPrint As Variant

Dim PrintBackground As Integer



On Error 208 Goto err208

Set app = createobject("Word.application")



Set docToPrint = app.documents.open(fname)

’ Turn off background printing to avoid error message cf. Microsoft Technote #Q170393

PrintBackground = app.Options.PrintBackground()

If PrintBackground = True Then app.Options.PrintBackground = False 

Call docToPrint.PrintOut()

app.Options.PrintBackground = PrintBackground 'Restore PrintBackground option



Call app.Quit(0) 

Set app = Nothing

Exit Sub

Subject: How To USE OLE Automation for PDF

If you are using the acrobat reader, it unfortunately does not support OLE, you must have the full acrobat product. Reader does however support command line printing. To find the command go to Tools->Folder properties for any folder in explorer, find the PDF entry and look at it’s print command. Sometimes it is not there, however you should be able to find complete details for reader command line and acrobat OLE printing on adobe’s site.