• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 548
  • Last Modified:

Save PrintScreen to file

Can anyone provide code that would allow me to do a PrintScreen (even if there
is an error on screen) and save the image to a file, preferrably jpg or html, but
I can live with bmp.  I know that I can capture using the PrintScreen key with a
KeyCode 44, but it doesn't work when there is an error on screen although the
Printscreen button itself is working because I can go to Paint and paste the image
in there.
0
Mach1pro
Asked:
Mach1pro
  • 4
  • 3
  • 2
  • +9
1 Solution
 
Jonathan KellyCommented:
are you trying to execute PrintScreen while the error msg is displayed or just before thr error msg appears ?
0
 
hotbudareCommented:
I'd use an utility like the oine found at: http://download.cnet.com/downloads/0-10077-100-5816716.html?tag=st.dl.10001-103-1.lst-7-1.5816716

HTH/EQTA
T.S.U. Mario Osorio
Punto Fijo, falcon, Venezuela
0
 
senan072100Commented:
is it after reciving the error message ?
senan
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Don ThomsonCommented:
If your just looking to past the image - hit printscreen and then paste it into word or wordpad.

What program are you getting the error in?
0
 
MarkSharkCommented:
I use a utility called SuperClip which is easy to use and you can save the screen in almost any format you like, or just print same. It can be found at: http://www.androsoft-usa.com 
0
 
NosterdamusCommented:
Hi Mach1pro,

Just a thought...

If it's a trapable error (if....), then you could add to your code (assuming that U R using Access) a hidden form with a OnTimer Event.

In the OnTimer Event, check for a flag (which will be set upon the trapable Error), if it is set, then KeyCode 44....

If you are going to try it, pls report....


Nosterdamus
0
 
mgrattanCommented:
Sorry, I just realized that this class is intended for VB and won't work from within Access.
0
 
nico5038Commented:
mgrattan writing his access memoires..... ;-)

BTW I would simply go for the DTHConsulting solution. the Printscreen key is always "ready" and a paste into the standard MSPaint will enable you to select the wanted part and save that as .jpg (under W98).

Nic;o)
0
 
Mach1proAuthor Commented:
Trying to trap the code won't work because I want a visual image of what is on the screen no matter when an error occurs or what type of error it is.
The idea is to have the computer illiterate simply press the Print screen key when an error comes up. I don't want them to have to open paint or any other program.  I want the image saved to a file where I can look at it at my convenience and then determine if the error is simply incorrect data being entered or if there is a coding issue that needs to be looked at.
0
 
webwomanCommented:
All printscrn does is copy the screen image to the clipboard. You have to put that somewhere. And you can't do that from within Access, the user is going to have to do it.

There are also a lot of things that could generate errors that have nothing to do with Access -- and the computer illiterate isn't going to know the difference. I can see you wading through Word errors, Powerpoint errors, browser errors, javascript errors, etc., etc., etc...

The error message also may or may not tell you anything, and the screen image is going to have that error prompt right over top of the form/report/whatever that they're using, which is going to make it a royal pain in the you-know-what to figure out what they did and how they got there.
0
 
Don ThomsonCommented:
Just a thought - can you trap the error - and call the Keycode 44 to get the error into the clipboard - then call a macro which calls a runapps function to load a word document which has a startup macro that does nothing but paste  (inserting the captured image) then saves and closes the word document. The next line of the macro would rename the word document to errmmddhhmmss.doc to give it a unique time stamp.  Cumbersome to set up but it would work quickly and efficently once you set it up.
0
 
hotbudareCommented:
webwoman,
>All printscrn does is copy the screen image to the
>clipboard. You have to put that somewhere. And you
>can't do that from within Access, the user is going to
>have to do it.
==> According to ADH, you can indeed manage the clipboard from Access, using API calls. You'd have to do some searching though, and this link will make a good start: http://www.allapi.net/

HTH/EQTA
T.S.U. Mario Osorio
Punto Fijo, Falcon, Venezuela
0
 
Jonathan KellyCommented:
have not tested this but it may be woth a try!

you could create a word template which contains a macro named autoexec.

the macro will simply execute word's paste function

add some code to your error trap to use the printscrn key
then open an instance of word from within access (VBA)
((the autoexec macro will load and paste whatever is on the clipboard to the document))
save the doc and close word via VBA






0
 
Don ThomsonCommented:
Datrias - I believe that is exactly the same as I suggested in my post on 08/01/2001  8:59pm

0
 
LunchyCommented:
Removed mgrattan's lengthy post at his request.

Lunchy
Friendly Neighbourhood Community Support Moderator

0
 
Jonathan KellyCommented:
Sorry DTHConsulting
0
 
Don ThomsonCommented:
Datrias - no problem - some of the comments get so long they if we stopped to read everything - we'de never have time to get out there and make a living <grin>
0
 
Mach1proAuthor Commented:
No workable solution was found to this question.  When an error is on screen in Access, hitting the PrintScreen button does copy the image to the clipboard, but Access itself is halted and doesn't recognize the key has been hit.
0
 
NosterdamusCommented:
For Mach1pro,

It's time to resolve this question, so I will leave a recommendation in Community Support Topic Area that this question is:
- PAQ'd and points refunded

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Thanks!
Nosterdamus
0
 
NetminderCommented:
Per recommendation, points refunded and question closed by
Netminder
CS Moderator
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 4
  • 3
  • 2
  • +9
Tackle projects and never again get stuck behind a technical roadblock.
Join Now