Public rowlab As Integer
'定义一个公用变量
Function prnt11(X As Integer, Y As
Integer,Font As Single, Txt As String, Val As Integer)
Dim str As String, str1 As String,
str2 As String ,i As Integer
Printer.CurrentX = X
Printer.CurrentY = Y
Printer.FontBold = False
Printer.FontSize = font
str = txt
str2 = str
i = 0
rowlab = 0
If Len(Trim(str)) = 0 Then
rowlab = 1 '待打印字符串为空的标志
Else
Do While Len(str) > 0
Printer.CurrentX = X
Printer.CurrentY = Y + rowlab * 240
rowlab = rowlab + 1
If Len(str) >= val Then
str1 = Mid(str, 1, val)
Printer.Print str1
i = i + 1
str = Mid(str2, i * val + 1)
Else
Printer.Print str
Exit Do
End If
Loop
End If
End Function