
HELP - Really, really simple printer questions
In this case, don't use the printer object at all. Open the printer port as a
file, and print directly to that:
Dim fh As Integer, i As Integer
fh = FreeFile
Open "LPT1" For Output As #fh
For i = 1 To 200
Print #fh, "Line " & i
Next i
Close #fh
On my LaserJet 4V, that code printed 60 lines per page, and didn't skip or
lose any lines.
Lee Weiner
weiner AT fuse DOT net
http://home.fuse.net/lweiner
Quote:
>I've checked with the online MS Knowledge Base and couldn't find an aswer. It
>seems like a simple problem and I'm just missing something.
>I've got a simple routine that spits out 200 lines to a priner:
>For i = 1 To 200
> Printer.Print "Line: " & i
>Next i
>My problem is that no matter if I print it to an HP laser printer or an old dot
>matrix, it does the form feed correctly after the first pages, BUT the next
>line is missing.
>So I'd see:
>Line 62
>Line 64
>How do I correct that?
>Ideally I wouldn't like any form feeds or anything, because I'm writing a
>routine that prints out index cards on a continuous form tractor feed. The old
>days of dealing directly with the lpt1 port are gone I guess.
>So I suppose another question is how to prevent the Printer object from sending
>end of page commands, end of docs, etc.? All I'm issuing is the Printer.Print
>command and it still manages to skip at line at the form and a final form feed
>at the end of the loop -- ends up wasting index cards.
>Any help would be appreciated.