Solved

Save PrintScreen to file

Posted on 2001-08-01
21
531 Views
Last Modified: 2012-06-27
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
Comment
Question by:Mach1pro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +9
21 Comments
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 6340952
are you trying to execute PrintScreen while the error msg is displayed or just before thr error msg appears ?
0
 
LVL 2

Expert Comment

by:hotbudare
ID: 6340954
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
 

Expert Comment

by:senan072100
ID: 6341051
is it after reciving the error message ?
senan
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 14

Expert Comment

by:Don Thomson
ID: 6341081
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
 

Expert Comment

by:MarkShark
ID: 6341106
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
 
LVL 7

Expert Comment

by:Nosterdamus
ID: 6341132
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
 
LVL 14

Expert Comment

by:mgrattan
ID: 6341313
Sorry, I just realized that this class is intended for VB and won't work from within Access.
0
 
LVL 54

Expert Comment

by:nico5038
ID: 6341326
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
 
LVL 6

Author Comment

by:Mach1pro
ID: 6341556
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
 
LVL 19

Expert Comment

by:webwoman
ID: 6341706
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
 
LVL 14

Expert Comment

by:Don Thomson
ID: 6343264
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
 
LVL 2

Expert Comment

by:hotbudare
ID: 6343470
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
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 6360008
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
 
LVL 14

Expert Comment

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

0
 
LVL 2

Expert Comment

by:Lunchy
ID: 6362130
Removed mgrattan's lengthy post at his request.

Lunchy
Friendly Neighbourhood Community Support Moderator

0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 6362952
Sorry DTHConsulting
0
 
LVL 14

Expert Comment

by:Don Thomson
ID: 6364173
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
 
LVL 6

Author Comment

by:Mach1pro
ID: 6417342
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
 
LVL 7

Expert Comment

by:Nosterdamus
ID: 6985862
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
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 6999275
Per recommendation, points refunded and question closed by
Netminder
CS Moderator
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question