VBA code for Printing PDF file

By dsivik ·
I am working on a MA Access projct that I would like to Print a selected PDF file and close adobe reader after it is printed. I have tried several different things and can't get it to work. I can get it to open the file in Adobe but can't seem to get it to print the file and close. Can anyone give me some examples or steer me in the right direction.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

See if this works for you......

Here is the code:

Dim AcroApp As CAcroApp
Dim AVDoc As CAcroAVDoc
Dim PDDoc As CAcroPDDoc
Dim IsSuccess As Boolean

Set AcroApp = CreateObject("AcroExch.App")
Set AVDoc = CreateObject("AcroExch.AVDoc")

AVDoc.Open "c:\windows\desktop\back_cover.pdf", ""

Set PDDoc = AVDoc.GetPDDoc

AVDoc.PrintPages 1, 1, 2, True, True

'Close the PDF
AVDoc.Close True

Set PDDoc = Nothing
Set AVDoc = Nothing
Set AcroApp = Nothing

Exit Sub

Collapse -

Same Error......

by dsivik In reply to See if this works for you ...

This looks similar to the other codes I've written and I get the same result. I get error and it highlights the line.......

[Set AcroApp = CreateObject("AcroExch.App")]

Back to Software Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums