Printing Different Formats From Diffeent Printers
Hi I am using ActiveX objects to control print jobs on two different printers from the same VB.NET application.
I have two different label sizes that need to be printed consecutively.
The code works for both label types seperately but when I try and execute both print jobs consecutively, both print jobs are produced on the first printer.
When I step through the code, everything looks fine but I cannot seem to switch to a different printer when I need to during runtime.
The required printer is set each time using the following procedure.
In Control Panel, the first printer (the one that receives both print jobs) is set as the default printer
I close the Bartender format object after each print job has completed and create a new instance of the format object at the start of each job. I have even tried creating two seperately named format objects so that there is no possibility of caching but this has not helped.
Any ideas? Thanks
Sub Set printer(ByVal StrRequiredPrinter as string)
dim i as integer
for i = 0 to Printersettings.installedprinters.count - 1
If strRequiredPrinter = printersettings.installedprinters.item(i) then
btFormat.Printer = printersettings.InstalledPrinters.Item(i)
Exit For
End If
Next
End Sub
-
Does "strRequiredPrinter" hold the name of the printer that each print job is supposed to print to? If that's the case why don't you set the printer to use via that value directly?
http://help.seagullscientific.com/10.1/en/#../Subsystems/ActiveX/Content/Printer_Property.htm
0 -
Hi,
I have just discovered my problem.
the code sample I displayed worked properly.
the problem was where it was being called in the code, i,.e. I was calling it 'before' the btFornat object was set properly to the associated bartender application object.
I am also using two application objects now and two format objects although I am not sure if this is necessary.
0 -
I believe this issue is now resolved.
it was a coding issue rather than a printer one.
I am also using only one Bartender application object and one format object.
Thanks for your help.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare