Question Locked

VBA: print .prn files to a network printer using LPR

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have this Word VBA code that merges a number of documents into .PRN files.

Next I want to send these .PRN files to a network printer using the lpr command.

At this moment I try to do this with the following piece of code:

' Send PRN files to Emtex
Call Shell("lpr -S 10.x.x.x -P dl-pcl" & strPath & "*.prn")

when debugging the code the step is passed without errors but no files appear in the printerqueue.

Does anyone have an idea how to do this?

Thanks in @vance
Jaap

3 replies

by j_kooijman

When I translate the variables into the right path and filename and enter the command from the command line.
then the files are transfered

this can mean two things, either the variables are not translated correctly
or, the shell command is not performed

I don't know how to test this

when I google on this shell(lpr .... command, I think I use it right

Thank you for the Drag&Drop alternative, only I need to make this unattended, just start the macro and forget ;)

This discussion is closed to new replies.