a command like PRINTFORM that saves as bmp file

I need a command similar to PrintForm that will save my screen to a file on my hard drive called something like x.bmp.

My High School tests show the results of the student's test on the screen and the screen is sent to the printer with the following in a command object called "PRINT".


I would now like to save a copy of this test on the hard drive in a folder called "PRINTOUTS". These would have sequential filenames like 1.bmp, 2.bmp etc.

There must be a simple way to save the screen as a bmp file from visual basic.
The PrintScreen key seems to do this, so there must be a simple command from vb for it.

I use visual basic 4 bacause it meets my needs and I am comfortable with it. I have VB6 but feel awkward and slow with it.
Who is Participating?
Mike TomlinsonMiddle School Assistant TeacherCommented:
Microsoft has a great project in their Knowledge Base that does screenshots via API's only...

The routines in the example can:

Capture the entire contents of a form.
Capture the client area of a form.
Capture the entire screen.
Capture the active window on the screen.
Capture any portion of any window given a handle to it.
Create a Picture object from a bitmap and a palette.
Print a Picture object as large as possible on the page.

It can be found here:

To save the captured area, use the SavePicture() function:

SavePicture Clipboard.GetData(vbCFBitmap), strFile
place this on the keydown event of a form or a command button.

if keycode = vbkeyprint then
     SavePicture Clipboard.GetData(vbCFBitmap), strFile
end if
strfile is the path where you want to put file including its name:
for example
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.