vb程序中表格的代码编写和打印机的指向

个人日记


Dim s() As String, X As Integer
X = Int(Len(Text15) / 26) + 1
ReDim s(X + 1) As String
Printer.ScaleMode = 6
Set Printer = Printers(1)  ‘打印机端口指定USB1
Printer.CurrentX = 11: Printer.CurrentY = 21
Printer.FontSize = 17: Printer.FontName = "黑体"
Printer.FontSize = 14: Printer.FontName = "仿宋_GB2312"
Printer.CurrentX = 20: Printer.CurrentY = 22: Printer.Print Text14
Printer.CurrentX = 30: Printer.CurrentY = 11
Printer.FontSize = 24: Printer.FontName = "方正行楷简体"
Printer.Print " 表头"
Printer.Line (10, 28)-(166, 64), , B
Printer.Line (10, 37)-(166, 37)
Printer.Line (10, 45)-(166, 45)
Printer.Line (10, 55)-(166, 55)
Printer.Line (10, 64)-(166, 64)
Printer.Line (32, 28)-(32, 63)
Printer.Line (53, 46)-(52, 45)
Printer.Line (82, 29)-(82, 45)
Printer.Line (104, 29)-(104, 45)
Printer.Line (82, 55)-(82, 64.6)
Printer.Line (104, 55)-(104, 64.6)
Printer.FontSize = 14: Printer.FontName = "仿宋_GB2312"
Printer.CurrentX = 12: Printer.CurrentY = 30: Printer.Print "name"
Printer.CurrentX = 35: Printer.CurrentY = 30: Printer.Print text2
Printer.CurrentX = 84: Printer.CurrentY = 30: Printer.Print "mm"
Printer.CurrentX = 105: Printer.CurrentY = 30: Printer.Print text3
Printer.CurrentX = 12: Printer.CurrentY = 39: Printer.Print "tel"
Printer.CurrentX = 33: Printer.CurrentY = 39: Printer.Print Text4
Printer.CurrentX = 84: Printer.CurrentY = 39: Printer.Print "ll"
Printer.CurrentX = 105: Printer.CurrentY = 39: Printer.Print text5
Printer.CurrentX = 11: Printer.CurrentY = 47: Printer.Print "kk"
Printer.CurrentX = 33: Printer.CurrentY = 47: Printer.Print "www”
Printer.CurrentX = 70: Printer.CurrentY = 47: Printer.Print text6
Printer.CurrentX = 11: Printer.CurrentY = 57: Printer.Print "uuu"
Printer.CurrentX = 35: Printer.CurrentY = 57: Printer.Print text7
Printer.CurrentX = 83: Printer.CurrentY = 57: Printer.Print "&"
Printer.CurrentX = 108: Printer.CurrentY = 57: Printer.Print text8
Printer.CurrentX = 106
Printer.CurrentY = 65
Printer.Print "日期" & Format(Date, "yyyy 年 m 月 d 日")
Printer.NewPage
Printer.EndDoc
Printer.KillDoc

文章评论