Discussion Locked

Automating Printing To a File

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

I am developing an application which requires
to use a specific printer drive but redirect
output to a file.

I know I can configure the printer driver to
redirect output to a file, but is there a way of
specifying the filename and thus prevent the user prompt for specifying the filename each time the
report runs.

Any advice would be appreciated

9 replies

by matjaz.demsar

Do you need to do this via printer driver? If not, you can use one of the Output functions...
I can't exactly remember where&how, but if you're working in VBS, VB there's a neat OutputTo command which enables you to output a file, database query orjust a form into one of Offices' supported formats.

by matjaz.demsar

In that case, try to search through the documentation of the printer driver in question, because there must programatic interface, which enables you to select "Print to file". More I don't know.

by jackofalltech

I don't think you can prevent the filename dialog from appearing but you could code a routing to wait for the dialog and then use SendKeys to specify the filename.

Ralph

by enquiries

Could you elaborate on "code a routing" & "SendKeys". I am a Visuual Fox Pro programmer but I am not familiar with either of
these terms.

by jackofalltech

First, that should have been "routine", my finger slipped.

Anyway, after you start whatever process initiates printing, code a loop that waits for the dialog window to exist. Then use SendKeys to send the keystrokes required by the dialog. I don't know anything about Foxpro but I would hope it either supports VBA or allows you to acces the Win32 API. If not, forget everything I've written, sorry.

Ralph

This discussion is closed to new replies.