You you want to use printer.print command in Visual Basic instead of that i would suggest you to use the below code
Code:
Sub PrintLpt1()
Dim bf As String
Dim vbEsc As String
vbEsc = Chr$(29)
'load string with escape codes
bf = vbEsc & "A" & vbEsc & "A3H0000V0000" & vbEsc & "Z"
bf = bf & vbEsc & "A" & vbEsc & "%2" & vbEsc & "H478" & vbEsc & "V105"
bf = bf & vbEsc & "D302054205215670190"
bf = bf & vbEsc & "H220" & vbEsc & "V105"
bf = bf & vbEsc & "D302054205215670190"
bf = bf & vbEsc & "%0" & vbEsc & "H294" & vbEsc & "V30"
bf = bf & vbEsc & "FW02H0176"
bf = bf & vbEsc & "H36" & vbEsc & "V30"
bf = bf & vbEsc & "FW02H0176"
bf = bf & vbEsc & "%3" & vbEsc & "H245" & vbEsc & "V42"
bf = bf & vbEsc & "PS" & vbEsc & "$A,24,24,0" & vbEsc & "$=521567"
bf = bf & vbEsc & "H501" & vbEsc & "V40"
bf = bf & vbEsc & "$A,24,24,0" & vbEsc & "$=521567"
bf = bf & vbEsc & "%2" & vbEsc & "H470" & vbEsc & "V30"
bf = bf & vbEsc & "$A,38,32,0" & vbEsc & "$=RM 720.90"
bf = bf & vbEsc & "H210" & vbEsc & "V30"
bf = bf & vbEsc & "$A,38,32,0" & vbEsc & "$=RM 1.90"
bf = bf & vbEsc & "H480" & vbEsc & "V128"
bf = bf & vbEsc & "$A,24,24,0" & vbEsc & "$=ABCDEFGHIJKLMNOP"
bf = bf & vbEsc & "H220" & vbEsc & "V128"
bf = bf & vbEsc & "$A,24,24,0" & vbEsc & "$=1234567890ABCDEF"
bf = bf & vbEsc & "Q1"
bf = bf & vbEsc & "Z"
Open "lpt1:" For Output As #1
Print #1, bf
Close #1
End Sub
Bookmarks