Solved

Save PrintScreen to file

Posted on 2001-08-01
21
524 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
  • 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now