Take picture from Form through VBA Smae as PRINT SCREEN (1 Viewer)

a_20120

tan
Local time
Today, 22:10
Joined
Nov 21, 2006
Messages
175
Hello EveryOne,
Is there a way to take a snapshot of the Current Form through VBA? and save it where we want? Same as PRINT SCREEN does...

Thanks in Advanced...
 

a_20120

tan
Local time
Today, 22:10
Joined
Nov 21, 2006
Messages
175
Hi all,
Could any one tell me plz how it is possible to Have the Print Screen of the Current Form through VBA? not the whole window, just the current form snapshot...
thanks in advanced
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 12:40
Joined
Feb 28, 2001
Messages
26,999
I did a quick search of my home copy of Access, admittedly not the most recent. I don't see anything that will do what you want. Given that a screen shot captures a window and Access doesn't manage windows (Windows does), adding code to Access to do this for you might not be in Microsoft's best (monetary) interests. They might have done it in a newer version than AC2002.

When I searched the forum, I didn't see anything that resembled a straight-out programmed screen capture. I did, however, find a reference to a place that offers a free download to do screen captures.

Try this link: http://www.wisdom-soft.com/

If this link isn't what you want then I don't see a way to get there from VBA without a LOT more research. If you wanted to get crazy, you might try to find a Win32 Programmer's Reference Manual (multi-volume set) and learn enough about window structure to be able to copy the window to a bitmap.

If you have the form open, it has a window handle (property .HWnd, I think), so you can directly reference it via its window identifier. The catch is to open an application that would do the work for you in capturing the bitmap that is the visual rendition of the programmed construct that is the window. This IMPLIES that you are sending a bitmap to a program that can handle bitmaps. Paint can do it but I don't know of a way to reference PAINT from VBA. (I don't believe it responds correctly to CreateObject in an attempt to open an application object.) If you find a way to open the clipboard from your version of Access, there is hope for you do control the clipboard. Other than that, I have no clue.
 
Last edited:

a_20120

tan
Local time
Today, 22:10
Joined
Nov 21, 2006
Messages
175
Thanks for the Replying,
Ok. I will search on API, I dont like to use external tools. What I want is to do Screen Capture through VBA in M.S Access...Thanks again for the Reply
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 12:40
Joined
Feb 28, 2001
Messages
26,999
Whoa, that's a good pair of links, Brett! I knew there was an API call but those are so hard to dig out somtimes.
 

a_20120

tan
Local time
Today, 22:10
Joined
Nov 21, 2006
Messages
175
Thanks very Much,
Yeah that link was what I want.
is it possible when we capture the Active Window, the Save dialog appear and we can save it where we want?
Thanks in Advanced...
 

BrettStah

Registered User.
Local time
Today, 12:40
Joined
Apr 15, 2007
Messages
49
Thanks very Much,
Yeah that link was what I want.
is it possible when we capture the Active Window, the Save dialog appear and we can save it where we want?
Thanks in Advanced...

I haven't tried it, but a google search turned up this code:
http://www.meadinkent.co.uk/aopendlg.htm

Read through it, and you'll see that you can use it to open either the File Open or File Save As dialog boxes.
 

ted.martin

Registered User.
Local time
Today, 17:40
Joined
Sep 24, 2004
Messages
743
Did you ever get this lot to work. I have a similar problem. I can get the Paste to work into Word but not into the Picture. A look at your code may help. Thanks
 

ted.martin

Registered User.
Local time
Today, 17:40
Joined
Sep 24, 2004
Messages
743
This piece of code is too easy !! hence it works. Form must be hidden or open. Thanks www.utteraccess.com

DoCmd.SelectObject acForm, "Form1"
DoCmd.PrintOut acPages, 1, 1
 

kevparky

New member
Local time
Today, 17:40
Joined
Oct 12, 2011
Messages
1
DoCmd.SelectObject acForm, "Form1"
DoCmd.PrintOut acPages, 1, 1

This does send the output to the printer but is there a way to output the screen dump as a PDF? I've tried Output to but doesn't work

Also, and this is a long shot, could the location be saved to a form text field?

Thanks
 

Users who are viewing this thread

Top Bottom