Option Explicit Dim colvb As Long Dim x As Long Dim y As Long Dim fnt As Long Dim txt As String Dim dd As Variant Public Function pt(colvb As Long, x As Long, y As Long, fnt As Long, txt As String) Printer.ForeColor = colvb Printer.CurrentX = x Printer.CurrentY = y Printer.FontSize = fnt Printer.Print txt End Function Private Sub Command1_Click() x = 5 y = 5 colvb = vbRed fnt = 15 txt = "瑞安市电器有限公司" dd = pt(colvb, x, y, fnt, txt) y = 12 colvb = vbBlue txt = "浙江省瑞安市经济开发区" dd = pt(colvb, x, y, fnt, txt) y = 19 colvb = vbBlue txt = "0577 65100000" dd = pt(colvb, x, y, fnt, txt) y = 26 colvb = vbBlue txt = "0577 65100000" dd = pt(colvb, x, y, fnt, txt) Printer.EndDoc End Sub
Dim colvb As Long
Dim x As Long
Dim y As Long
Dim fnt As Long
Dim txt As String
Dim dd As Variant
Public Function pt(colvb As Long, x As Long, y As Long, fnt As Long, txt As String)
Printer.ForeColor = colvb
Printer.CurrentX = x
Printer.CurrentY = y
Printer.FontSize = fnt
Printer.Print txt
End Function
Private Sub Command1_Click()
x = 5
y = 5
colvb = vbRed
fnt = 15
txt = "瑞安市电器有限公司"
dd = pt(colvb, x, y, fnt, txt)
y = 12
colvb = vbBlue
txt = "浙江省瑞安市经济开发区"
dd = pt(colvb, x, y, fnt, txt)
y = 19
colvb = vbBlue
txt = "0577 65100000"
dd = pt(colvb, x, y, fnt, txt)
y = 26
colvb = vbBlue
txt = "0577 65100000"
dd = pt(colvb, x, y, fnt, txt)
Printer.EndDoc
End Sub