-
Is there any way to export data from a form to a file. I don't care the type of the file. Could be html, or JPG or whatever. What I want to export is not just text, I would like my exported data to include a photo.
I mean, my app shows pupils data in a form: name, gender, address, telephone, etc. And it also show the pupil's photo (if available) Does anybody now how to export all this info (photo included) into any kind of file?
-
<?>
'give this a shot..I find sometimes it acts up and grabs the whole screen and I don't know why.
'
Code:
Private Declare Sub keybd_event Lib "user32" _
(ByVal bVk As Byte, ByVal bScan As Byte, _
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Public Sub CaptureScreen(ByVal sFileName As String)
Call keybd_event(vbKeySnapshot, 0, 0, 0)
SavePicture Clipboard.GetData(vbCFBitmap), sFileName
DoEvents
End Sub
Private Sub Command1_Click()
Call CaptureScreen("C:\my documents\asdfg.bmp")
End Sub
-
I gave it a shot. It seems to work. And I guess I already know why it captures the whole screen. However I don't know how not to do it. The Function captures the whole active "window". And if your app is an MDI project, your active window would be your app's parent. By the way, does anybody knows how to capture one of its child window?
-
<?>
'that's what I mean by acting up
try this:
Call keybd_event(vbKeySnapshot, 1, 0, 0)
the 0,0,0 is supposed to get only the form
the 1,0,0 is supposed to get the screen
but for reasons unknown to me It screws up
There is a good app I once had and I will look for it
again that handles different versions or how to do this.
I will look for it and if you send me and email and I find
it I will send it to you.
Wayne
-
<?>
-
EXCELLENT!! That was what I was needing. THANKS A LOT!