With VB.Printer
.PaperSize = 256 ' 用户自定义大小
.Width = CInt(paperWidth) * 56.7
.Height = CInt(paperHeight) * 56.7
End With
.PaperSize = 256 ' 用户自定义大小
.Width = CInt(paperWidth) * 56.7
.Height = CInt(paperHeight) * 56.7
End With
' 打印一条记录
Dim i As Long, m As Integer
For i = 1 To labCount
PrintText Lab2Field(labFields(i).Caption, Rs), labFields(i).Left, labFields(i).Top, labFields(i).ForeColor, labFields(i).fontsize
Next i
For i = 1 To TxtCount
PrintText labTexts(i).Caption, labTexts(i).Left, labTexts(i).Top
Next
VB.Printer.EndDoc
End SubPublic Sub PrintPicture(Optional text As String)
' 打印一个图片
Dim pic As Picture
Set pic = VB.Clipboard.GetData
With VB.Printer
.ScaleMode = 1 'mm
' 纸张大小(A4)
.PaperSize = 9
' 打印图片
.PaintPicture pic, VB.Printer.Width / 2 - pic.Width / 3, 400 'Form1.Width / 2 - pic.Width / 3, 400
' 确定坐标
.CurrentX = 400
.CurrentY = pic.Height / 1.5 + 1
End With
If Len(text) <> 0 Then VB.Printer.Print text
VB.Printer.EndDoc
End Sub
“无效属性值”
“无效属性值”