参考以下的定位打印代码: Option Explicit Dim x As Integer Dim y As Integer Dim fnt As Byte Dim txt As String Dim dd As VariantPublic Function prnt(x As Variant, y As Variant, fnt As Variant, txt As Variant) Printer.CurrentX = x Printer.CurrentY = y Printer.FontSize = fnt Printer.Print txt End FunctionPrivate Sub Command1_Click()'打印字符串 Printer.FontSize = 36 Printer.Print "This is the first line of text in a pair." Printer.Print "This is the second line of text in a pair." Printer.EndDoc End Sub Private Sub Command3_Click()'打印文本内容 fnt = 16 x = 100 y = 100 txt = Text1 dd = prnt(x, y, fnt, txt) Printer.EndDoc End SubPrivate Sub Form_Load() Text1 = "打印"
Option Explicit
Dim x As Integer
Dim y As Integer
Dim fnt As Byte
Dim txt As String
Dim dd As VariantPublic Function prnt(x As Variant, y As Variant, fnt As Variant, txt As Variant)
Printer.CurrentX = x
Printer.CurrentY = y
Printer.FontSize = fnt
Printer.Print txt
End FunctionPrivate Sub Command1_Click()'打印字符串
Printer.FontSize = 36
Printer.Print "This is the first line of text in a pair."
Printer.Print "This is the second line of text in a pair."
Printer.EndDoc
End Sub
Private Sub Command3_Click()'打印文本内容
fnt = 16
x = 100
y = 100
txt = Text1
dd = prnt(x, y, fnt, txt)
Printer.EndDoc
End SubPrivate Sub Form_Load()
Text1 = "打印"
按的要求先做过.Rpt文件,若不是一般的pagersize只是自定义size