beck<br>
<br>
It may be crude, but I format a string for each print line<br>
and call a routine to either print the line or output it to a file if the user has checked a 'print to screen' option button. The program will perform something like the following when the report is done:<br>
<br>
If checkspool.Value = 1 Then ' if print-to-screen button<br>
Close #1<br>
prspool.Show vbModal 'call a rich text box form<br>
DoEvents<br>
Else<br>
Printer.EndDoc<br>
End If<br>
<br>
'--rich text box called to display printlines saved to file<br>
'-- rich text box 'width' must be > 'scale width' property<br>
Private Sub Form_Load()<br>
<br>
prspool.WindowState = 2 'maximize form at run time<br>
<br>
<br>
textfile.SelFontName = "courier new"<br>
textfile.SelFontSize = 8<br>
On Error GoTo TooBig<br>
textfile.LoadFile App.Path & "\prspool.txt", rtfText<br>
<br>
CleanUp:<br>
<br>
Exit Sub<br>
TooBig: 'error handler displays message<br>
MsgBox ("The specified file is too large."

<br>
Resume CleanUp: 'then jumps to CleanUp routine<br>
End Sub<br>
<br>
Private Sub Form_Unload(Cancel As Integer)<br>
textfile.text = ""<br>
DoEvents<br>
Unload Me<br>
End Sub<br>
<br>
'---note-----<br>
'---this code is used in the main program as each print<br>
'---line is created<br>
Public Sub prmode()<br>
<br>
If checkspool.Value = 1 Then<br>
Print #1, RTrim(printline)<br>
Else: Printer.Print printline<br>
End If<br>
printline = " "<br>
End Sub<br>
<br>