p; strBarTable(22) = "110000001" 注释: M strBarTable(23) = "001010001" 注释: N strBarTable(24) = "101000001" 注释: O strBarTable(25) = "011000001" 注释: P strBarTable(26) = "000110001" 注释: Q strBarTable(27) = "100100001" 注释: R strBarTable(28) = "010100001" 注释: S strBarTable(29) = "001100001" 注释: T strBarTable(30) = "100011000" 注释: U strBarTable(31) = "010011000" 注释: V strBarTable(32) = "110001000" 注释: W strBarTable(33) = "001011000" 注释: X strBarTable(34) = "101001000" 注释: Y strBarTable(35) = "011001000" 注释: Z strBarTable(36) = "000111000" 注释: - strBarTable(37) = "100101000" 注释: % strBarTable(38) = "010101000" 注释: contentnbsp; strBarTable(39) = "001101000" 注释: * If strBarCode = "" Then Exit Sub 注释: 不打印空串 注释: 保存打印机 ScaleMode Dim intOldScaleMode As ScaleModeConstants intOldScaleMode = Printer.ScaleMode 注释: 保存打印机 DrawWidth Dim intOldDrawWidth As Integer intOldDrawWidth = Printer.DrawWidth 注释: 保存打印机 Font Dim fntOldFont As StdFont Set fntOldFont = Printer.Font Printer.ScaleMode = vbTwips 注释: 设置打印用的坐标刻度为缇(twip=1) Printer.DrawWidth = 1 注释: 线宽为 1 Printer.FontName = "宋体" 注释: 打印在条码下方字符的字体和大小 Printer.FontSize = 10 Dim strBC As String 注释: 要打印的条码字符串 strBC = Ucase(strBarCode) 注释: 将以毫米表示的 X 坐标转换为以缇表示 Dim x As Integer x = Printer.ScaleX(intXPos, vbMillimeters, vbTwips) 注释: 将以毫米表示的 Y 坐标转换为以缇表示 Dim y As Integer y = Printer.ScaleY(intYPos, vbMillimeters, vbTwips) 注释: 将以毫米表示的高度转换为以缇表示 Dim intHeight As Integer intHeight = Printer.ScaleY(intPrintHeight, vbMillimeters, vbTwips) 注释: 是否在条形码下方打印人工识别字符 If bolPrintText = True Then 注释: 条码打印高度要减去下面的字符显示高度 intHeight = intHeight - Printer.TextHeight(strBC) End If Const intWidthCU As Integer = 30 注释: 粗线和宽间隙宽度 Const intWidthXI As Integer = 10 注释: 细线