Link to home
Start Free TrialLog in
Avatar of katzwhite
katzwhite

asked on

Export a form as .JPG

I can export charts (graphs) using graphchart.export.

Is it possible to export a form as .JPG file.  I have many graphs with additional controls on the form that need to be included in the jpg output.

If possible, please explain how for additional points.

Thanks

Elton
Avatar of HobsonT
HobsonT

There may be a way through code, but I don't know it.

You could do it manually with the assistance of a graphics program that will save in jpg format. To do this open the form that you want to export, press and hold the Alt key, press the Print Screen key (usually near the Scroll Lock key) open your graphics program and use paste (Ctrl-V) to paste the image, save it as a jpg.

Hope this helps.

Trevor
SOLUTION
Avatar of Alan Warren
Alan Warren
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ryan Chong
Yes, definitely can be done.

What i will do is put a Imag Control (Picture Box) in the form, make it Visible to False (No), then try use below code to generate the JPG file.

Here is a popular sample that uses the Intel JPG DLL to allow you to save a picturebox's picture out to a JPG file:

http://www.vbaccelerator.com/codelib/gfx/vbjpeg.htm

Hope this helps
And here is an example to capture form image:

Private Declare Sub keybd_event Lib "user32" _
(ByVal bVk As Byte, _
 ByVal bScan As Byte, _
 ByVal dwFlags As Long, _
 ByVal dwExtraInfo As Long)

 Private Const TheScreen = 0
 Private Const TheForm = 1

Private Sub Command1_Click()
    Dim s As Integer
    s = IIf(Option1(0).Value, TheScreen, TheForm)
    keybd_event vbKeySnapshot, s, 0&, 0& 'Change to TheScreen to make Screen Capture
    DoEvents
    Picture1.Cls
    Picture1.Picture = Clipboard.GetData(vbCFBitmap)
    'Printer.PaintPicture Clipboard.GetData(vbCFBitmap), 0, 0
    'Printer.EndDoc
End Sub

Private Sub Form_Load()
    Option1(0).Caption = "Print Screen"
    Option1(1).Caption = "Print Form"
    Option1(0).Value = True
    Command1.Caption = "Print Now"
    Command2.Caption = "Print Form"
End Sub
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of katzwhite

ASKER

We can use a graphics problem as long as it can be started with a control button that will activate a script that will pass the stored image name and execute automatically with no user intervention.

Since we can print the form, an ideal solution would be to convert the printed image to jpg.  Kinda like creating a pdf file by printing to a pdf printer.

Any suggesitons?

Thanks

Elton
Hi katzwhite,
This question has been abandoned and needs to be finalized (96 days since last comment).

   You can accept an answer, split the points, or get a refund. Go to
   http://www.cityofangels.com/Experts/Closing.htm for information and options.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

nexusnation
EE Cleanup Volunteer for Microsoft Access