See Also Example
Sends a bit-for-bit image of a non-MDI form to the printer.
The argument form is the non-MDI form to print. If omitted, the current form is printed. PrintForm prints all visible controls and bitmaps on the form. PrintForm also prints graphics added to the form or picture controls on the form at run time if AutoRedraw is True when the graphics are drawn.
The printer used by PrintForm is determined by the Microsoft Windows control panel.
PrintForm Method Example
The example uses the PrintForm method to print the current form. To try this example, paste the code into the Declarations section of a form. Place on the form any controls you want to see in the printed form. Then press F5 and click the form.
Sub Form_Click ()
Dim Msg ' Declare variable.
On Error GoTo ErrorHandler ' Set up error handler.
PrintForm ' Print form.
Msg = "The form could not be printed."
MsgBox Msg ' Display message.