Ezra
Ezra

Reputation: 191

Printing pdf file with VBA is not doing anything

I want to print external pdf files from MS-Access using VBA.

I use this command:

CreateObject("Shell.Application").Namespace(0).ParseName("file_to_print.pdf").InvokeVerb("Print")

Printing with this command text files (*.txt) works fine, but pdf does not.

The context menu when right clicking on the pdf file has no print Option:

]

The context menu of the text file has a print command. I read somewhere that this is needed for the above printing to work.

Any solution for this?

I use Windows 10, and Acrobat Reader is installed.

Upvotes: 0

Views: 1630

Answers (1)

Ezra
Ezra

Reputation: 191

I found the issue, the problem was that the default application for pdf was Microsoft Edge, I changed it to Acrobat Reader, and now it is printing.

Upvotes: 1

Related Questions