First, place this code in a public module:
Global Const WM_PAINT = &HF
Global Const WM_PRINT = &H317
Global Const PRF_CLIENT = &H4& Global Const PRF_CHILDREN = &H10&
Global Const PRF_OWNED = &H20&
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Place a picturebox somewhere on your form. Name it "FormPicture". Set its Visible property to False, AutoRedraw to True, and BorderStyle to None.
Then, in the module that is to do the printing, put this code:
Dim rv As Long
FormPicture.Width = Me.Width
FormPicture.Height = Me.Height
FormPicture.BackColor = Me.BackColor
Me.SetFocus
rv = SendMessage(Me.hwnd, WM_PAINT, FormPicture.hDC, 0)
rv = SendMessage(Me.hwnd, WM_PRINT, FormPicture.hDC, PRF_CHILDREN + PRF_CLIENT + PRF_OWNED)
FormPicture.Picture = FormPicture.Image
FormPicture.Refresh
Printer.PaintPicture FormPicture.Picture, 0, 0
Printer.EndDoc
OK, this prints your form and ( most of ) it's controls to the page.
This is essentially what "PrintForm" does, but this allows you to specify *where* on the page your form will be printed, and how many times you want to print it on the page ( before issuing the Printer.EndDoc command )
By modifying the line:
Printer.PaintPicture FormPicture.Picture, 0, 0
We specify the place on the page the form will be printed. the last two numbers in that line are Single values that specify the X and Y position on the printer page, for the Top / Left corner of your form. ( look up PaintPicture on MSDN for more on what this command can do )
By looping through the print commands 3 times, changing the position of your form to print out each time, then giving the Printer.EndDoc command, you get the required 3 times per page.
Note: Some controls will not print their contents with this code as is. Most of the standard ones will, but the Picturebox will not. If you have any Pictureboxes on your form, Set your forms AutoRedraw to True, and transfer their images to the form like this: ( This also applies to FlexGrids. )
Me.PaintPicture Picture1.Picture, Picture1.Left, Picture1.Top
And then make the picturebox invisible before you print the form:
Picture1.Visible = False
After printing the form, reset it's picture value to nothing:
Set Me.Picture = Nothing
And make your picturebox visible again.
Hope this helps to get you on track.
Robert