Archived from groups: microsoft.public.windowsxp.print_fax (
More info?)
I don't normally drop into this newsgroup, but while I was researching
something else, I ran across your post. I have some information that
might help. This is based on general printing but may be possible to
port to printing to a file.
The printing a page per line is MS's standard operation for the VB and
VBA object. See MS's technote 175083 - How To Print Line-by-Line to a
Printer. In that technote they describe an alternative and how you can
do it via the Win32API. There could be a base for what you are looking
for in there.
Another quick and dirty option that might work is is to use the RSView
ME activeX control "Program Launch" (see RA TN A20818). Assign a string
tag and stuff it with this:
Cmd.Exe /c echo {your message here} >prn
I think the control should accept this shelled out command. The >PRN is
to direct to a printer. You can replace it with
>>C:\filedirectory\filename.txt (note the two ">"s) to append an
existing file. If the file does not already exist, the file is created
and subsequent writes are appended.
This does bypass the automatic pagefeed.
Some things to be aware of:
This won't work for the embedded OS versions of RSViewME.
If using the ">PRN", make sure you configure the printer in question to
be the default Windows printer.
If using the ">PRN", configure the printer driver to print directly to
the printer.
If using ">>C:\filedirectory\filename.txt", make sure the directory
already exists.
Print failures (such as an off-line or out of paper printer) are
handled by the OS. If there is a failure, the OS presents a
Cancel\Retry prompt after a (configuable) time-out. The time-out period
is set in the printer port configuration. The defaul time is 90
seconds. The OS caches the print jobs until told to cancel them by the
user, or until the problem is corrected. There should be a prompt in
the taskbar if there is an error, but you need to make sure its visible
in your desktop to see it.
Either case, you'll need to test this to make sure it works for your
application. When I looked into this it was for specialized printing an
RSViewSE project. In that case we had some portions running the quick
and dirty method and some using code based on the MS technote.
Good Luck,
Ray
These are my personal opinions and do not reflect those of my employer.
TonyC wrote:
> The program I am printing out of is RSView Machine Edition by
Rockwell
> Automation. It is HMI (Human Machine Interface) software that
communicates
> with and provides operator interface to an Allen Bradley (also
Rockwell
> Automation)PLC (SLC5/05). It is running under Windows XP, on an
industrial
> Pentium computer.
>
> I don't know any details about the printing process, or why it spools
a job
> for every line. I have tried to figure this out at the Rockwell
Automation
> Knowledge base, but this kind of detail doesn't seem to be provided
there.
>
> I have tried communication with technical support at our local
distributor,
> since Rockwell Automation expects this kind of support to come from
their
> distributors, but I have difficulty getting any response.
>
> I will experiment further with your suggestion of Prindir9.
>
> But thanks for your effort already.
>
>