>I'm attempting to make a variety of systems (W94, NT4 and W2000) print consistently to a rather pathetic bar code printer, which may or may not be the local (LPT1) printer.
>Essentially I've resorting to fiddling with Expr, Tag and Tag1 in the .lbx file, leaving it as read-only and compiling the label into the executable.
>
>My code switches the printer using
>SET PRINTER TO NAME Label_printer_name
>
might include a UNC path, but that doesn't seem to be too much of a problem. >Then it simply prints the label and switches the printer back to the default. >I don't want the user having to spend time selecting printers. > >However on NT4 for example the thing always prints to LPT1 which is where the label printer is located on my development machine, even though the named printer exists on the network. >If I remove the LPT1: reference from the Expr field and delete Tag and Tag1 contents from label.lbx then it seems to work. But I don't know why or if that's what I should be doing. In other words I'm voodoo programming :-) >Can anyone say how this ought to be done? Clearing the device assignment data from the Report will let it use the printer settings for the assigned printer rather than relying on the embedded printer data. This is written up in the FAQ. My experience with label printers has been that not using the ReportWriter or any of the Windows GDI functions gives the best control; the label printers that I work with usually offer an ActiveX control that bypasses the normal Windows printing layers to avoid problems like form position resets, or I've written my own driver in C to do it; I normally do not want the Windows GDI stepping in and doing things like resetting the printer to a standard mode between label printing, and don't want the spooler stepping in to buffer and defer output - most of my applications that use label printers want the label generated immediately, not when the spooler gets around to it, and I normally need to either use form addressing of the printer, like the Monarch label printers use, or I want to send detailed control sequences without Windows interpreting them. Just my $0.02