printer问题
经调试printer.currnetX,currnentY的值都是正确的,可打印出来却不对,不知问题所在,有谁发现了,请指教一下
Dim a() As String
Dim str As String '定义一个数组存储一个段落的字符
Dim i, z, x, k, p As Long
Printer.ScaleWidth = 210
Printer.ScaleHeight = 297
x = 194
a = Split(Form2.Text1.Text, Chr(13)) '将TEXT文本以段为单位付给字符串数组A
For z = LBound(a) To UBound(a) 'X为A的上限至下限
For i = 1 To Len(a(z)) Step 28 '把A中的段落分成28个字符一组
Printer.CurrentX = 23 '定义X坐标
x = x + 10
Printer.CurrentY = x '定义开始Y坐标
k = Printer.CurrentX '调试语句
p = Printer.CurrentY '调试语句
str = Mid(a(z), i, 28) 调试语句
If Printer.CurrentY < 270 Then '如果未到达底线
Printer.Print Trim(Mid(a(z), i, 28)) '打印单个字符
Else
Printer.NewPage '否则换页
'打印格式
'打印第二页页首
Printer.ScaleWidth = 210
Printer.ScaleHeight = 297
Printer.CurrentX = 152
Printer.CurrentY = 15
Printer.Print "第 页共 页"
Printer.DrawWidth = 6
Printer.Line (158, 21)-(166, 21)
Printer.Line (179, 21)-(188, 21)
'打印横线
Printer.CurrentX = 22
Printer.CurrentY = 25
Printer.DrawWidth = 10
Printer.Line (22, 25)-(198, 25)
Dim j As Integer
For j = 35 To 275 Step 10
If j = 275 Then
Printer.DrawWidth = 10
Printer.Line (22, j)-(198, j)
Else
Printer.DrawWidth = 6
Printer.Line (24, j)-(195, j)
End If
Next j
Printer.CurrentX = 23
Printer.CurrentY = 30 '定义新一页的y坐标
x = 30
Printer.Print Mid(a(z), i, 28) '继续打印字符
End If
Next i
Next z
===============================================
form2.text1.text中的内容为
kkkkkkkkkkkkkkkkkkkkkkkkkk
kkkkkkkkkkkkkkkkkkkkkkkkkk
kkk
kkkkkkkkkkkkkkkkkkkkkkkkkk
kkkkkkkkkkkkkkkkkkkkkkkkkk
kkk
打印出来为
kkkkkkkkkkkkkkkkkkkkkkkkkk
kkkkkkkkkkkkkkkkkkkkkkkkkk
kkk
kkkkkkkkkkkkkkkkkkkkkkkkkk 问题在句,与下一句重叠半个字符,且X坐标从0开 始
kkkkkkkkkkkkkkkkkkkkkkkkkk
kkk