Hi,
I am currently trying to write a small VB application to print barcodes on a zebra 90xiII printer. Currently, the printers is hooked up to a computer and shared via the network. My VB application allows me to select the printer from the network and print out labels. The problem occurrs when i want use the zebra resident fonts to generate the barcode symbology. When i switch the fontname to ZB 128* 7mil and run my code. The font is defaulted back to arial. Any ideas why this happens. Additional, if i go into excel and set the font to ZB 128* 7mil and print from excel i get the a barcode with the correct symbology. Any ideas? My code that i am using is below.
Thanks,
Tmreic
Private Sub Form_Load()
Dim P As Printer
For Each P In Printers
Combo1.AddItem P.DeviceName
Next P
Combo1.Text = Combo1.List(0)
End Sub
Private Sub cmdPrint_Click()
Dim variable As String
variable = Me.txtBarcode
If Combo1.Text <> "" Then
Dim P As Object
For Each P In Printers
If P.DeviceName Like "*" & Combo1.Text & "*" Then
Set Printer = P
'MsgBox Combo1.Text & " is now the Default Printer"
Exit For
End If
Next P
Else
MsgBox "You did not select a printer"
Exit Sub
End If
Printer.Font.Name = "ZB 128B* 7 mil" ' barcode font
Printer.FontSize = 36 'Use this font for 1/4" inch lbl
Printer.CurrentY = 10
Printer.Print variable;
Printer.Font.Name = "Zebra Font A"
MsgBox Printer.Font.Name
Printer.FontSize = 8
Dim HFONT
HFONT = Me.txtBarcode_Read
Printer.Print Spc(2); HFONT
Printer.EndDoc 'This tells the printer to eject the page
End Sub
Private Sub cmdExit_Click()
End
End Sub
I am currently trying to write a small VB application to print barcodes on a zebra 90xiII printer. Currently, the printers is hooked up to a computer and shared via the network. My VB application allows me to select the printer from the network and print out labels. The problem occurrs when i want use the zebra resident fonts to generate the barcode symbology. When i switch the fontname to ZB 128* 7mil and run my code. The font is defaulted back to arial. Any ideas why this happens. Additional, if i go into excel and set the font to ZB 128* 7mil and print from excel i get the a barcode with the correct symbology. Any ideas? My code that i am using is below.
Thanks,
Tmreic
Private Sub Form_Load()
Dim P As Printer
For Each P In Printers
Combo1.AddItem P.DeviceName
Next P
Combo1.Text = Combo1.List(0)
End Sub
Private Sub cmdPrint_Click()
Dim variable As String
variable = Me.txtBarcode
If Combo1.Text <> "" Then
Dim P As Object
For Each P In Printers
If P.DeviceName Like "*" & Combo1.Text & "*" Then
Set Printer = P
'MsgBox Combo1.Text & " is now the Default Printer"
Exit For
End If
Next P
Else
MsgBox "You did not select a printer"
Exit Sub
End If
Printer.Font.Name = "ZB 128B* 7 mil" ' barcode font
Printer.FontSize = 36 'Use this font for 1/4" inch lbl
Printer.CurrentY = 10
Printer.Print variable;
Printer.Font.Name = "Zebra Font A"
MsgBox Printer.Font.Name
Printer.FontSize = 8
Dim HFONT
HFONT = Me.txtBarcode_Read
Printer.Print Spc(2); HFONT
Printer.EndDoc 'This tells the printer to eject the page
End Sub
Private Sub cmdExit_Click()
End
End Sub