Click to See Complete Forum and Search --> : Print Text and Form


le3
October 7th, 2001, 03:33 PM
I want to print some text and a form on the same sheet. With this code, the text is never printed :

Printer.print "Bhla bhla"
frmPrint.PrintForm
Printer.EndDoc



I could use Printer.PaintPicture, but I don't know how to turn my Form into a Picture...

Anybody could help me ?

deghost
October 7th, 2001, 04:30 PM
have you tried : Form1.PrintForm method?

----------
The @host is everywhere!
----------

le3
October 7th, 2001, 04:46 PM
Yes... e.g. :

Printer.print "My Title"
Form1.PrintForm




Form1 is Printed but not the text I want to print on the same sheet (Ie.: "My title") ???

le3
October 7th, 2001, 05:11 PM
Here is my own temporary solution. Actually, it prints the MDI window. I want to print one of the Child windows...

Clipboard.Clear
DoEvents
keybd_event VK_MENU, 0, 0, 0
DoEvents
keybd_event VK_SNAPSHOT, 0, 0, 0
DoEvents
keybd_event VK_MENU, 0, KEYEVENTF_KEYUP, 0
DoEvents

Printer.print "My Title"
Printer.print

Printer.PaintPicture Clipboard.GetData(vbCFBitmap), 0, 1500

Printer.EndDoc




PS.: keybd_event is a call to the API (lib user32)
It emulates a "Alt-Print Scrn"