Printing Order Of Serialized Copies 追蹤

Legacy Poster



I currently am in the situation of printing labels that use an Excel document as its source and then updates the source based on the number of copies it prints. This is currently working just fine. The issue I am having is when I print multiple labels I let the users select how many copies per label they would like. This varies at times and cannot be a constant.


The printing order currently prints like the example below:


- 2 unique labels "A" and "B"

- 3 copies of each, so 6 total labels should be printed, 3 of "A" and 3 of "B".


The current printing order is A,A,A,B,B,B. What I need is for the labels to print out A,B,A,B,A,B. The issue might be with the serialization I have setup to write back to the source document.


The VB I am using is here and is in the OnSerialize portion of the Script Assistant:


'Define the object names.
dim objConn
dim strConn
dim rs
varSerial = 0
'Define the database connection parameter constants.
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adCmdText = &H0001
'Connect to the Excel file.
Set objConn = CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='C:\Seagull\TTChinaParts.xls';Extended Properties=""Excel 8.0;HDR=YES;"""
'Create a record set of one record which is the current record being printed.
Set rs = CreateObject("ADODB.Recordset") "SELECT * FROM [Sheet1$]", objConn, adOpenStatic, adLockOptimistic, adCmdText
rs.Find "part_code = '" & Format.NamedSubStrings("PartCodeSource").Value & "'"
varSerial = rs.Fields("seqno")
'Increase the Serial by one for each printed label
if varserial=99999 then
rs.Fields("seqno") = varSerial + 1
end if
Any ideas on this? Any help at all is greatly appreciated. 

2 意見

Ian Cummings
評論操作 永久連結

I suppose the use of Batch Maker would be needed to achieve this collated printing result.  Add both of your labels to the batch, copies for each set to 1, and then adjust the "Batch Repeat Count" for the number of times the labels will be printed.

Legacy Poster
評論操作 永久連結

Thanks, I was thinking along those lines and your post made it "click" for me. I ended up writing back to the source document, marking a column with a "Y" for being printed, and have a second label looking for the "Y" flag to print a duplicate. That and some tweaking, thrown into a batch, working as intended. Thanks.