You need to use the Printer.TextWidth function and compare it to the Printer.ScaleWidth property in order to handle this issue in Visual Basic 6. It does not do automatic line wrapping for you like the DOS function.
You will make sure that the font that the printer is set too correctly match the font of the printer. This may require to use one of the "printer" fonts the driver comes with. Otherwise try to use Courier New which is a fixed space font. Otherwise the Text Width value is not going to correctly report the width.
An alternative is to use the Len string function to count the number of characters and handle the truncation yourself if it exceeds 89 characters.,
Something like like
Do Until LineToPrint = ""
TempD = Len(LineToPrint)
If TempD > 89 Then
Print Mid$(LineToPrint,1, 89)
LineToPrint = Right$(LineToPrint,TempD-89)
Else
Print LineToPrint
LineToPrint = ""
End If
Loop
If you like Recursive Functions you could write it like this
Private Sub PrintLine(ByVal LineToPrint As String, ByVal Width As Integer)
TempD = Len(LineToPrint)
If TempD > Width Then
Printer.Print Mid$(LineToPrint, 1, Width)
LineToPrint = Right$(LineToPrint, TempD - Width)
PrintLine LineToPrint, Width
Else
Printer.Print LineToPrint
End If
End Sub