Maybe this will do the job:
Put this code in Form module witch Form you want to print!
Private Sub Command1_Click()
'dim ......... put here declarations ......
'********************** Printing a limit box (only for probe)****************
Printer.ScaleMode = vbCentimeters
Printer.Orientation = 2 ' or 1
HorizontalMargin = (29.7 - Printer.ScaleWidth) / 2
VerticalMargin = (21 - Printer.ScaleHeight) / 2
HorizontalMargin = HorizontalMargin ' in my case!!!!!
VerticalMargin = 1 + VerticalMargin ' never mind
Printer.Print "";
Printer.Line (HorizontalMargin, VerticalMargin)-(29.7 - HorizontalMargin - 1, 21 - VerticalMargin), RGB(0, 0, 0), B
'*************************************************
Printer.ScaleMode = 1
Dim c As Control 'use c as the generic control object
For Each c In Controls
If TypeOf c Is Label Then ' for all labels
Printer.FontName = c.FontName
Printer.FontSize = c.FontSize
Printer.FontBold = c.FontBold
Printer.FontItalic = c.FontItalic
Printer.FontUnderline = c.FontUnderline
Printer.FontStrikethru = c.FontStrikethru
Printer.ForeColor = c.ForeColor
Printer.CurrentX = c.Left
Printer.CurrentY = c.Top
Printer.Print c.Caption;
End If
If TypeOf c Is TextBox Then 'for all textboxes
Printer.FontName = c.FontName
Printer.FontSize = c.FontSize
Printer.FontBold = c.FontBold
Printer.FontItalic = c.FontItalic
Printer.FontUnderline = c.FontUnderline
Printer.FontStrikethru = c.FontStrikethru
Printer.ForeColor = c.ForeColor
Printer.CurrentX = c.Left
Printer.CurrentY = c.Top
Printer.Print c.Text;
End If
If TypeOf c Is PictureBox Then 'for all PictureBoxes
Printer.CurrentX = c.Left
Printer.CurrentY = c.Top
c.AutoSize = True
c.Refresh
c.AutoSize = False
Printer.PaintPicture c.Picture, c.Left, c.Top
End If
If TypeOf c Is Image Then 'for all Images
Printer.CurrentX = c.Left
Printer.CurrentY = c.Top
Printer.PaintPicture c.Picture, c.Left, c.Top
End If
If TypeOf c Is Line Then 'for all lines
'make requisted lines properties equal with Printer object properties.......
Printer.Line (c.X1, c.Y1)-(c.X2, c.Y2)
End If
' And so on:
'first put "if TypeOf c Is AnyControl Then"
'then make the properties of AnyControl equal with Printer object properties
'and print. ....
Next c
Printer.EndDoc
End Sub