With VB.Printer
        .PaperSize = 256                   ' 用户自定义大小
        .Width = CInt(paperWidth) * 56.7
        .Height = CInt(paperHeight) * 56.7
    End With

解决方案 »

  1.   

    ' 尺寸比较:1twip = 1/1440 Inch = 1/56.7 mm = 1/20 point = 1/567 cm
      

  2.   

    Public Sub PrintRecord(Rs As ADODB.Recordset)
        ' 打印一条记录
        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
      

  3.   

    to: wuzhu(wuzhu) PaperSize  =  256                 '  用户自定义大小 这句出错。提示
    “无效属性值”
      

  4.   

    可是我要定义的比A4小啊,还是不行PaperSize = 256 ' 用户自定义大小 这句出错。 提示 
    “无效属性值”