Re: Printing to only USB printer



"F L A S H" <flash@xxxxxxxxx> wrote in message
news:8cb%e.98959$Ph4.3111111@xxxxxxxxxxxxxxxxxxxxxxxxxx

> Print_Line = Val(txtPro.Text)
> numlabels = Val(txtNumPros.Text)
> Print_ProConst = "pro:"
> For i = 1 To numlabels
> Printer.Font = "arial": Printer.FontSize = 15: Printer.FontBold = False
> Printer.Print Print_ProConst; Spc(1);
> Printer.Font = "arial": Printer.FontSize = 55: Printer.FontBold = True
> Printer.Print Print_Line
> On Error Resume Next
> Call ClearTextBoxes(Me)
> txtPro.SetFocus
> Printer.NewPage
> Next i

Can't see anything obviously wrong there (although you haven't shown where
you declare your variables). You could start off by using the correct syntax
for addrssing the font object (rahter than relying on the backwards
compatible stuff). For example, instead of Printer.FontSixe = 15 you should
really be using Printer.Font.Size = 15 (and the same goes for Font.Bold).
Also, you might try explicitly using "name" for the font, instead of relying
on it being the default property, instead of Printer.Font = "arial" you
should use Printer.Font.Name = Arial (notice the extra dot and the proper
case name). By the way, the first thing you should do when you get a problem
like this is to try exactly the same code on exactly the same machine, but
sending your oputput to a different printer (if you have one) or perhaps to
a Picture Box. I'll check it out again when I get back to my XP machine
thouhg, and let you know if I find anything. One other thing you could try
is getting rid of that spc function. It is similar in many respects to the
Tab function (both spc and Tab perform some calculations that you might not
expect them to perform and they can both be troublesome on some printers,
and I would advise against using them). Instead of:

Printer.Print Print_ProConst; Spc(1);

use:

Printer.Print Print_ProConst & " ";

Mike




.