I use
Visual Basic 8.0
Zebra GX430t TT label printer
ZebraDesigner which I use defined the barcode label ,called barcodelabel.lbl
SDK for Zebra
I have a simple question.
Can I use the same code as shown below to print defined Zebra label (barcodelabel.lbl) to a Zebra printer?
What should I change this code to pull it off?
Dim myDymo As Object
Dim myLabel As Object
Dim sPrinters As String
Dim arrPrinters() As String
Dim i As Long, i2 As Long, iStart As Long
On Error Resume Next
Set myDymo = CreateObject("Dymo.DymoAddIn")
Set myLabel = CreateObject("Dymo.DymoLabels")
If (myDymo Is Nothing) Or (myLabel Is Nothing) Then
MsgBox "Unable to create OLE objects"
Exit Sub
End If
sPrinters = myDymo.GetDymoPrinters()
If sPrinters = "" Then
Exit Sub
Else
i2 = 0
iStart = 1
For i = 1 To Len(sPrinters)
If Mid(sPrinters, i, 1) = "|" Then
i2 = i2 + 1
ReDim Preserve arrPrinters(i2 + 1)
arrPrinters(i2) = Mid(sPrinters, iStart, i - iStart)
iStart = i + 1
End If
Next i
End If
sDefaultPrinter = Application.ActivePrinter
With myDymo
.SelectPrinter arrPrinters(0)
End With
'Open the label template
myLabel = myDymo.Open("C:\SomeFolder\test.LWL")
'Give text objects OText1 and OText2 on the label a value myLabel
myLabel .SetField( "OText1", "123456")
myLabel.SetField ("OText2", "artcile x")
'Print the label
myDymo.print(1,fasle)
'Make sure the default printer is selected again
Application.ActivePrinter = sDefaultPrinter
'Clean up
Set myLabel = Nothing
Set myDymo = Nothing