| | Sub PrintBarcodeLabels()
Dim ticketServer As Object
' Create the OLE Automation Objects Set ticketServer = CreateObject("TICKET.Document") Set ticketLabel = ticketServer.LoadLabel("testlabel.lb") Set ticketData = ticketLabel.SetInternalDataTable("datarecords")
' Optionally set data... or you could simply load
' a label to connects to an external database ' But here we use code to set data fields...
ticketData.CurrentRecordPosition = 1 ticketData.FieldValue "barcode", "102992993" ticketData.FieldValue "title", "Test Title One"
ticketData.CurrentRecordPosition 2 ticketData.FieldValue "barcode", "299299393"
ticketData.FieldValue "title", "Test Title Two"
ticketData.CurrentRecordPosition 3 ticketData.FieldValue "barcode", "999393993" ticketData.FieldValue "title", "Get the idea"
ticketData.CurrentRecordPosition 4 ticketData.FieldValue "barcode", "999393993" ticketData.FieldValue "title", "A very long line shrinks the font size"
' Easy to setup default values ticketData.SetDefaultFieldValue "Organisation", "Peach Corporation Inc"
' Ready to print the label ticketLabel.LabelPrint 3
' Tidy up Set ticketData = Nothing Set ticketLabel = Nothing Set ticketServer = Nothing
End Sub | |